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,624
questions
0
votes
0
answers
24
views
Want to add API response to eclipse code editor temporarily and once click outside temporarily portion Api response should disappear
I am using the below code to write Api response in eclipse code editor.
StyleText textWiget =(StyleText) textEditor.getAdapter(Control.class);
textWiget.replaceTextRange(insertOffset, 0, apiResponse);
...
0
votes
1
answer
30
views
Visual Studio 2022 - indent closing function paren with beginning of argument
In Microsoft driver code (even the driver templates included in VS), they frequently format the function signature like this:
VOID
EvtIoStop(
_In_ WDFQUEUE Queue,
_In_ WDFREQUEST Request,
...
0
votes
0
answers
38
views
VS Code : force horizontal alignment of parentheses, braces and square brackets
Is there any way to auto format code (in VS Code) in a way that forces horizontal alignment of parentheses, braces and square brackets?
For example:
let foo = {
a: 'a',
b: 'b',
c: 'c'
};
...
0
votes
0
answers
34
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
0
answers
13
views
Enforcing Consistent Code Formatting for HTML and Typescript (VS Code & WebStorm)
I'm in a team working on Angular projects and using Prettier for code formatting (HTML, TypeScript, SCSS). We're encountering merge conflicts due to inconsistent Prettier formatting across team ...
0
votes
0
answers
29
views
Formatting issues with PhpStorm for React/RN
I'm having issues with my PhpStorm settings where it's wrapping on save. I'm not seeing any setting that would allow me to prevent this. I've confirmed it's not Prettier or ESLint causing the issue.
...
2
votes
0
answers
24
views
Pre tag with style="white-space: pre-line" removes leading spaces as desired, but how can I prevent it from losing internal spacing?
I'm having an issue with the HTML pre tag. If I do a very simple test it preserves spacing the way that I want it to. For instance, notice that there are two spaces in a row in certain parts of the ...
0
votes
1
answer
137
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 ...
4
votes
2
answers
179
views
How do you set formatting rules for C# spread operator in Visual Studio?
I know this is probably not the right place to ask this, but I doubt I'd find an answer somewhere else.
Visual Studio 17.9.5 will, by default, format the following snippet as such
int[] arr = [1, 2];
...
2
votes
2
answers
367
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
0
answers
27
views
Why Intelij inserts space after final parameter in annotations when using Reformat Code
Why does Intelij randomly decided to insert space after final parameter in every annotation.
How it was until now:
@GetMapping("/something")
@Tag(name = "Something", description = &...
1
vote
0
answers
36
views
Having space problem while using phpfmt [code formatter] with ...$variable_name
Here is my example code where i am having error while using phpfmt [code formatter].
function ( int | float...$numbers ): int | float {
return array_sum( $numbers );
};
Here as we can see in the ...
0
votes
1
answer
117
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
112
views
Common Lisp formatting/indentation
(defun heapify-down (heap-id
index)
(if
(is-leaf heap-id
index)
nil
(let ((left (left-child index))
(right (right-child index))
...
-1
votes
1
answer
77
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 ...