Incorrect (potentially) indentation of function arguments spanning multiple lines
See original GitHub issueFrom @nomaed on October 14, 2016 10:40
- VSCode Version: 1.6.1
- OS Version: macOS Sierra 10.12
Steps to Reproduce:
- Write a function (or a method) with several arguments (I did it with JavaScript and TypeScript files, but I believe any would work).
function myFunc(arg1, arg2, arg3, ...args) {
}
- Split arguments to several lines by hitting Enter before arguments
function myFunc(arg1,
arg2,
arg3,
...args) {
}
Auto-formatting produces this result:
function myFunc(arg1,
arg2,
arg3,
...args) {
}
I would expect to see this result instead though:
function myFunc(arg1,
arg2,
arg3,
...args) {
}
Also, when manually formatting the arguments to appear in the same column (note: this is also the default/recommended setting in tslint
and maybe other linters), then further lines will start with wrong indentation:
function myFunc(arg1,
arg2,
arg3,
...args) {
console.log('huh...');
}
Copied from original issue: Microsoft/vscode#13748
Issue Analytics
- State:
- Created 7 years ago
- Reactions:30
- Comments:21
Top Results From Across the Web
PEP-8: clarify if multiline argument list with a closing `)` on a ...
When using a hanging indent the following should be considered; there should be no arguments on the first line and further indentation ...
Read more >Automatic indentation of arguments list on multiple lines in ...
Under menu Tools → Options → Text editor → C/C++ → Formatting → Indentation → "Within parentheses, align new lines when I type...
Read more >Function argument/parameter indentation - style - Rust Internals
For multiline function signatures, each new line should align with the first parameter. Multiple parameters per line are permitted:.
Read more >Automatic Indentation Of Arguments List On Multiple Lines In Visual ...
Incorrect potentially indentation of function arguments spanning multiple lines #11629. Open. waderyan opened this issue on Oct 14.
Read more >OCaml Programming Guidelines
In the case of an iterator whose argument is a complex function, ... If code is copy-pasted all over the place then the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
My prefered style for large
method
/function
signatures:It would be best to provide a configuration so a user can choose which way to go.