1,664 questions
4
votes
1
answer
143
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 ()
{
}
}...
2
votes
1
answer
124
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:
...
1
vote
0
answers
150
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 ...
1
vote
1
answer
157
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 ...
0
votes
0
answers
49
views
How to control formatting of attributes with explicit expressions in Razor components using Rider with editor config setup
I can't for the life of me figure out how to do this, if possible.
When using explicit expressions as values for EventHandlers or actions on components, is there a way to define how you want them ...
1
vote
2
answers
243
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 ...
0
votes
2
answers
937
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 ...
2
votes
0
answers
48
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 ...
7
votes
2
answers
275
views
How to prevent Delphi from formatting a code block?
I would like to be able to keep Delphi from formatting a specific block of text because it is much easier to read when formatted in a specific way, but pressing Ctrl+D will make it much harder to read....
0
votes
1
answer
123
views
SQL formatting in DataGrip
I use DataGrip 2022.2.1. When I use code formatting AND condition in new line set before JOIN
select pfv.value
from pay.PaymentFields pf
inner join pay.PaymentFieldValues pfv on pfv.id = ...
0
votes
0
answers
62
views
Clang format option to "explode" function declarations
I'm looking for a Clang configuration that will convert code A into code B (see below).
My preference is to "explode" functions with 3 or more arguments for personal readability, and I haven'...
0
votes
0
answers
66
views
Shortcuts for auto indentation not working
I want to use the command Reindent Selected Lines or Reindent Lines with a shortcut. I tried setting keybindings to each of them but when I press them in notebooks or scripts (using Python), nothing ...
1
vote
1
answer
1k
views
How to auto format HTML (.cshtml) documents on save (VS2022)
I rely on clean-up profile with the "run on save" checked to ensure my code is formatted on save:
'Format code' and 'sort using' on save in Visual Studio 2022
While that ...
2
votes
1
answer
96
views
clang-format option to set penalty for breaking preprocessor directives
Is there an option to set the penalty for breaking preprocessor directives into multiple lines?
For example, if I have the following snippet:
#define my_constant 1 // Lorem ipsum dolor sit amet, ...
1
vote
1
answer
122
views
how to clang-format long array of strings, to have strings in multiple columns
Below is the clang-format of ".h" header file with variable size of strings.
string a[x] = {
"masfasdno",
"iasdst",
"xafdsfayz",
"pqssssr&...
0
votes
0
answers
54
views
IntelliJ SQL-Formatter to indent SET after UPDATE
How can I modify the IntelliJ SQL-Formatter to insert an indent before the SET (after an UPDATE)?
Current code:
UPDATE role
SET is_available = 0
, is_updated = 1
WHERE name = 'Admin';
Desired ...
0
votes
1
answer
763
views
Visual Studio Code Cleanup: How to avoid removing unassgiend/unused variable when file is on save
I am using Code Cleanup in Visual Studio and noticed when file is on save.
The unused variable will be removed like:
I tried editing the .editorConfig file but it didn't seem to work with any of the ...
5
votes
2
answers
3k
views
How to automating Code Formatting in VSCode for Jupyter Notebooks with Black Formatter?
I've been enjoying the convenience of the Black Formatter extension in Visual Studio Code, especially its "Format on Save" feature for Python files. Being able to automatically format my ...
0
votes
1
answer
595
views
Is there a way to code format info.plist file like prettier?
If the info.plist file changes, the PR changes and it's very cumbersome to modify. Is there a way to modify it through github action or CI build? Or I'm looking for a way to keep it consistent through ...
0
votes
2
answers
861
views
How do I configure prettier to not separate my attributes onto new lines and not separate my opening bracket and closing bracket?
Before I state any of my problems this is my .prettierrc file so far
{
"semi": true,
"useTabs": true,
"tabWidth": 4
}
Problem 1:
I would like my prettier to ...
1
vote
1
answer
1k
views
Visual Studio Code - Microsoft Black Formatter from command line?
I have the Microsoft Black Formatter extension in VSCode (in WSL, inside Windows 11). I can format opened python files with no problem, one-by-one, either using keyboard shortcut or right click on the ...
4
votes
0
answers
144
views
Format brace-list of lambda expressions nicely
Is there any way I can setup clang-format to nicely* format an expression like this?
foo({
[](int) {
bar();
baz();
},
[](float) {}
});
With my current config this gets ...
-1
votes
1
answer
45
views
Does a code transformer / formatter exist that will add curly braces to Typescript code
I want all the code in our repository to always use blocks enclosed with brackets for the clauses of if statements, loops and even for inline functions. The following code is banned:
const func = () =&...
1
vote
1
answer
1k
views
How to Configure Prettier/ESLint to Keep Space Between Function Name and Parentheses? VS Code
I'm using Visual Studio Code for a JavaScript project and facing a formatting challenge with Prettier, which I'm using in conjunction with ESLint. My preference is to maintain a space between the ...
1
vote
2
answers
200
views
How to work with poorly formatted Code in VSCode without committing format changes?
I am currently working on a project in Visual Studio Code that has poorly formatted code. Due to project constraints, I am not allowed to reformat the existing code and commit those changes. This ...