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
{{ message }}
Repository navigation
0.10.8 Salsa Intellisense does not keep indentation level on new lines #7022
Upon enabling Salsa, when pressing Enter to go to a new line; the cursor will always jump to the beginning of the line instead of keeping the indentation level of the line before it, this happens in JavaScript files.
I'm not sure if this was caused solely by Salsa or a combination of other settings. But when turning Salsa off, the indentation works properly again.
Here is my config before adding the Salsa config path.
// Place your settings in this file to overwrite the default settings
{
// Controls the rendering size of tabs in characters. Accepted values: "auto", 2, 4, 6, etc. If set to "auto", the value will be guessed when a file is opened.
"editor.tabSize": 4,
// Controls if the editor will insert spaces for tabs. Accepted values: "auto", true, false. If set to "auto", the value will be guessed when a file is opened.
"editor.insertSpaces": true,
// Controls after how many characters the editor will wrap to the next line. Setting this to 0 turns on viewport width wrapping
"editor.wrappingColumn": 0,
// Controls if the editor should automatically format the line after typing
"editor.formatOnType": true,
// Complete functions with their parameter signature.
"javascript.suggest.useCodeSnippetsOnMethodSuggest": false,
// When enabled, will trim trailing whitespace when you save a file.
"files.trimTrailingWhitespace": true
}
I have encountered the same issue. Using Windows 10, VS code 0.10.8, Sasla with [email protected] and the following config. No extensions.
// Place your settings in this file to overwrite the default settings
{
"editor.renderWhitespace": true,
"editor.formatOnType": true,
"editor.insertSpaces": false,
"typescript.tsdk": "C:\\Program Files\\nodejs\\node_modules\\typescript\\lib"
}
The issue seems to be formatOnType as you mentioned. Disabling this or Salsa fixes it
This is a TS formatter issue. I debugged it and VSCode correctly indents the new line, however the tsserver send an edit back for format on type which removes the indent.
I believe this is related #5983, which treats the indentation on the new line as trailing white spaces and removes it. We may need to avoid formatting the current line for the enter case.
Activity
dbaeumer commentedon Feb 11, 2016
From alexandrudima on February 10, 2016 22:40
I think it is
formatOnTypedbaeumer commentedon Feb 11, 2016
From alexandrudima on February 10, 2016 22:41
lionpants Do you have specific repro steps please?
dbaeumer commentedon Feb 11, 2016
From Jared Klopper (@optical) on February 10, 2016 23:8
I have encountered the same issue. Using Windows 10, VS code 0.10.8, Sasla
with [email protected]and the following config. No extensions.The issue seems to be
formatOnTypeas you mentioned. Disabling this or Salsa fixes itdbaeumer commentedon Feb 11, 2016
This is a TS formatter issue. I debugged it and VSCode correctly indents the new line, however the tsserver send an edit back for format on type which removes the indent.
zhengbli commentedon Mar 1, 2016
I believe this is related #5983, which treats the indentation on the new line as trailing white spaces and removes it. We may need to avoid formatting the current line for the
entercase.mccreeker commentedon Feb 2, 2018
This has not been fixed, it's happening for me in PHP and HTML code.