1,663 questions
Score of 4
1 answer
346 views
Format on save duplicates the final line of Python files
When using the Black Formatter and isort extensions for VS Code and both are configured to format on save, the final line of the Python file is sometimes duplicated on save.
"editor....
Score of 4
1 answer
270 views
How to configure .clang-format to indent access modifiers in a class definition?
I want my C++ class definitions to have access modifiers indented like below:
class Foo
{
public:
Foo(Bar bar);
Foo(Bar *bar);
};
Foo::Foo(Bar bar)
{
if ()
{
while ()
{
}
}...
Score of 0
1 answer
216 views
How do I configure the VS Code C_Cpp extension's auto insertion of linebreaks before braces?
VS Code is auto inserting linebreaks before my curly braces. I have always used K&R style braces, and would like to use that style for C++ inside of VS Code. Does anyone know how I can configure ...
Score of 2
1 answer
294 views
How can I get CLion not to indent the case lines within a switch statement?
I'm using CLion to work on some C++ project. When I write case statements, CLion always indents my case lines, like so:
switch(foo) {
case bar_1:
do_stuff(); break;
case bar_2:
...
Score of 0
0 answers
138 views
How to make "align wrapped arguments" a default formatting behavior in Visual Studio 2022
I want this kind of long parameters list to wrap automatically on saving or running formatter ctrl + k + d.
And not the wrapping from Options => Text Editor => C# => General
Not this:
I know ...
Score of 1
0 answers
221 views
.editorconfig Support in Windsurf IDE for C# Formatting
I've been trying to get automatic code formatting working with my .editorconfig settings in Windsurf IDE for my C# codebase.
I tried the Prettier extension, but found it doesn't support C#. I also ...
Score of 2
1 answer
209 views
How to use Prettier as beautifier of user's code? [closed]
In my project Prettier is already connected for the project code formatting. I'm trying to use Prettier for user's code formatting in Ace Editor:
import * as prettier from 'prettier';
import * as ...
Score of 2
1 answer
303 views
How to break construct into multiple lines?
I'm new to COBOL, and I'd like to understand continuation if a line is too long. I know that there is a free form, but originally (in strict mode), the line length is limited.
I'd like to split the ...
Score of 1
0 answers
65 views
clang-format causing unnecessary line breaks after disallowing single line lambda
Code:
auto transs = transitions | stdv::filter([alph](const auto trns) { return trns.first == alph; })
| stdv::values | stdv::transform([](auto x) { return x; }) | stdv::as_rvalue;
...
Score of 1
2 answers
300 views
How to easily and quickly apply custom indentation format rule to selected Pascal/Delphi code?
I am working with Pascal/Delphi code and need to format a selection of code with custom indentation rules (e.g. 4 spaces for indentation). I want to apply these formatting rules to the selected code ...
Score of -1
1 answer
213 views
How to revert auto formatting changed lines and save the file
Actions on save -> checked,
Reformat changed lines -> checked
Optimize imports -> checked.
This works excellently most of the time, but sometimes I want my own formatting to remain.
I seem ...
Score of 0
2 answers
1495 views
VSCode adds unwanted extra spaces on enter
I am using VSCode since a couple years and have recently changed computers.
After installing VSCode, I came upon this issue:
lets say I have a list like this:
int_list = [
1, 2, 3, 4,
]
and now I ...
Score of 0
0 answers
69 views
How to prevent Vue extension from "fixing" my code?
I'm experiencing an issue where "unreachable code" in a Vue/TypeScript file is automatically deleted on save. (A pretty shocking behaviour, often I'm temporarily adding a "return false&...
Score of 2
0 answers
66 views
Eclipse indenting of nested HTML tags in Javadoc comments
Suppose I have Javadoc comment with:
/**
* <ul>
* <li>stuff</li>
* <li>stuff</li>
* </ul>
*/
When I run any of the eclipse formatting methods on ...
Score of 1
1 answer
1301 views
Why won't my C# code format correctly in Visual Studio 2022?
Even when I use the shortcut Ctrl+K Ctrl+D (Or Edit>Advanced>Format Document) in VS 2022, this C# code won't format properly:
Why won't the Visual Studio 2022 formatter fix these issues? How ...