-
Notifications
You must be signed in to change notification settings - Fork 30.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore the indentNextLinePattern
rule when next line satisfies the increaseIndentPattern
rule
#209822
Comments
After discussion with the team we decided not to pursue the idea in #209804. Instead, we can solve the above problem the following way:
|
This looks like the ideal solution we're looking for, as long as standard intentation rules would apply (e.g. 2 space, 4 space, tab, etc.) and it would support auto indentation in the following cases:
|
Not sure I should report this here.
when input "{", code become:
It should unindent when input "{"
|
Hi what is the indentation level on that line? It will not outdent if the indentation level is not the exact default indentation level because it will be assumed that the indentation is indentation. Could you please show a video of this behavior? I can change the code if needed. What version of VS code are you on? Are you on Insiders or Stable, the fix is not out on stable yet. |
{
"javascript.format.placeOpenBraceOnNewLineForControlBlocks": true,
"javascript.format.placeOpenBraceOnNewLineForFunctions": true,
}
|
Hi thank you for the quick response. You are on the latest stable release. A fix for this has been merged recently and is in the latest Insiders release. The next stable release will come out this week. The current behavior on the latest Insiders release is: Screen.Recording.2024-06-25.at.11.18.52.mov |
This issue will be closed, as the fix is in Insiders |
This issue derives from the issue #209804 and #43244 (comment).
Recently we have modified the
indentNextLinePattern
pattern so that after a braceless if statement, on pressing Enter, we indent the next line as follows (here the dots signify white spaces):Some users have mentioned in the thread of the link above, that upon writing
{}
they would like the line to outdent, as follows:We need to polish this.
The text was updated successfully, but these errors were encountered: