-
Notifications
You must be signed in to change notification settings - Fork 35.9k
Open
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugeditor-autoindentEditor auto indentation issuesEditor auto indentation issuesjavascriptJavaScript support issuesJavaScript support issuestree-sitter-autoindent-candidatetypescriptTypescript support issuesTypescript support issues
Milestone
Description
I am experiencing some weird indentation issues. Not using any plugins to prettify or similar.
if (condition) {
return; // <-- correct indentation
}
if(condition)
return; // <-- incorrect indentation
Some ppl claim this should be avoided. I don't agree. Using pair of { } for simple early exits messes up code. Putting the return on the end of the same line can be hard to read if the condition is long.
This is not exclusive to return. Applies to all single lines.
same problems apply to for, while, etc.
var transformedValues =
originalValues <-- incorrect should be indented one level.
.where(condition) <-- incorrect, should be indented two levels.
.select(transform); <-- incorrect, should be indented two levels.
function someFunction() {
callToSomeOtherFunction(
variableWithLongNameWhichRequiresASeparateLine,
anotherVariableWithLongNameWhichRequiresASeparateLine);
} <-- incorrect should not be indented.
function ... <-- incorrect the rest of the file is indented.
Spongman, phuein, stanislavdavid, lpaladin, Azarlak and 40 more
Metadata
Metadata
Assignees
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugeditor-autoindentEditor auto indentation issuesEditor auto indentation issuesjavascriptJavaScript support issuesJavaScript support issuestree-sitter-autoindent-candidatetypescriptTypescript support issuesTypescript support issues