You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After writing the following line if (someCondition)
and then pressing the 'enter' key, the caret position in the new line will have the same indentation as the 'if' statement, which results in incorrect indentation.
Example:
Caret position is represented by the '|' sign.
Actual Result:
if (someCondition)
|
Expected Result:
if (someCondition)
|
Same happens for other statements such as 'for' etc.
The text was updated successfully, but these errors were encountered:
This is currently "by design". We don't add tabs after a newline is entered. Even typescript doesn't add a tab in these scenarios in VS Code. VS 2017 does add the tab though, so we'll probably support this eventually.
Ah, I see. Yeah, the tab is being added by VS Code itself and not our extension. Using Enter after { is treated as started a scope so it is able to auto-indent, but whatever code is handling this doesn't understand one-line blocks that require indentation. Since the issue repros with Typescript and both languages share the same if/for/etc. statements, maybe VS Code itself could implement a fix. Maye this VS Code issue would address it: microsoft/vscode#16998 .
After writing the following line
if (someCondition)
and then pressing the 'enter' key, the caret position in the new line will have the same indentation as the 'if' statement, which results in incorrect indentation.
Example:
Caret position is represented by the '|' sign.
Actual Result:
Expected Result:
Same happens for other statements such as 'for' etc.
The text was updated successfully, but these errors were encountered: