Questions tagged [code-formatting]
Code formatting is the way to format the source code of programs, such as using spaces and tabs, improving legibility.
code-formatting
1,625
questions
-1
votes
2
answers
178
views
VS Code code formatting for TypeScript and JavaScript [duplicate]
I'm looking for extensions or JSON settings to format my code given below:
if(true)
{
}
else
{
}
and not like below:
if(true){
} else {
}
0
votes
0
answers
38
views
Color code font to 1) function arguments and 2) iterators in loops
I would like function arguments and iterators in loops to have a different color than the rest of the code. I am currently using the 'Merbivore Soft' theme, and in the code below...
fn <- function(...
3
votes
0
answers
147
views
CLion Nova code formatting: new scope on the same line as previous scope
When i format c++ code in clion it puts new scope { at the same line as the previous } of an if statement for example.
what i want:
if (...) {
...
}
{
// Some Code
}
what it does:
if (...) {
...
} {
...
1
vote
1
answer
53
views
certain VBA keywords (Add, Format) can't capitalize properly in VBE (As if I declared it as variable)
I was writing my code as usual, until suddenly I realized that certain keywords (so far, it is add and format) that won't capitalize properly after entering the line, as if it was set as variable name,...
0
votes
0
answers
154
views
How can I make VS Code format C/C++ function return types on their own line?
I'm on macOS. GNU C++ in Visual Studio Code automatically format like
int
main ()
{
...
}
Instead I want to do :
int main()
{
...
}
Follows my current settings:
"[cpp]": {
"...
4
votes
0
answers
447
views
Project-wide formatting options for `dart format`
I want to use dart format to format dart code, but my team uses custom format rules – such as line length of 120 characters and a few other things. Currently, code is formatted using settings in the ...
2
votes
1
answer
560
views
How to allow 2-line if statements using clang-format
I am working on setting up a style format check for a large library. Currently, our team styleguide prefers that instead of one line if statements, we use a "2 line" statement, which looks ...
1
vote
1
answer
158
views
How do I stop ReSharper/Rider from doing this: "}, {"
How do I prevent rider from generating }, { between chopped elements of an initialization?
I looked through Editor --> Code Style --> Braces Layout/Line Breaks and Wrapping, but I may have ...
0
votes
0
answers
30
views
Pycharm - JSX, How to surround style classes, id's in whole file with curly braces '{}'?
I am using Pycharm and i am curious, how to surround style classes in a file with curly braces - {}. So, I am trying to learn some React, and yesterday i did it, but i do not remember how i did it, ...
0
votes
1
answer
221
views
How to add custom separator between functions using clang format?
I have a C and C++ code base which I format using clang format. I'd like to make my code easy to read by placing separators between functions in the following way:
//-----------------------------------...
0
votes
0
answers
618
views
how to setup a jsconfig.json for node.js
So I started to learning Node.js recently so far the gatherings all are good but I came across the concept of setup with jsconfig.json which largely helps to free the clutters made in mentioning the ...
-1
votes
1
answer
50
views
No proper formatting in React App.js in VS Code
Working on React got this improper formatting of code
import logo from './logo.svg';
import './App.css';
function App() {
return (
<div className="App">
<header ...
0
votes
1
answer
188
views
How to make clang-format not break after = signs and not BinPackArguments
I'm using clang-format with a small configuration file, based on the Microsoft style.
---
BasedOnStyle: Microsoft
BinPackParameters: 'false'
BinPackArguments: 'false'
ColumnLimit: '120'
#Other options....
0
votes
1
answer
60
views
How to reverse the effect of code style "Chop down if long"?
I have a big multi-dimensions array like this (the ouput of a PhpUnit provider) :
return [
'my first test case' => [
$variable1,
$variable2,
$variable3,
$...
0
votes
1
answer
29
views
Intellij - how to force split on operator rather than on max size
How to tell intellij to split lines like Eclipse does:
private static final boolean VERY_VERBOSE = !(System.getProperty( "veryverbose" ) == null
|| System.getProperty( "...