-
Notifications
You must be signed in to change notification settings - Fork 29.5k
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
File reformatting to 4 spaces for indentation on save. #28327
Comments
It's not just indentation. It reformats the file to some defaults it sees fit. a=b;c=d; gets spit into multiple lines on saving. Also, replicated this issue in HTML files. |
This suddenly started happening to me as well. |
Yeah. And now I've seen it happen in so many cases. Unminifies HTML, JS on save, with four spaces. Happens in js, json, html files. but doesn't in ts, c, go for me. |
I have the same. Anybody solved it? |
It turns out I had a different issue which was related to the C# extension. |
I found that JS-CSS-HTML Formatter extension affects on indents. |
^This seems to be the problem. Set Closing this issue for now. |
EDIT: It's not just indentation. It reformats the file to some defaults it sees fit.
a=b;c=d;
gets spit into multiple lines on saving. Also, replicated this issue in HTML files.Steps to Reproduce:
When I open the file, the indent guides are at 2 stops. The status bar says
Spaces: 2
. But hitting save reformats the code to 4 spaces. Happens with eslint enabled and disabled. No workspace settings. Global setting hasfiles.formatOnSave
asoff
by default andeditor.tabSize
as2
. This has started happening recently after updating to the latest version.If I reopen the file now, the status bar says
Spaces: 4
with 4 spaces in indent guides. Now I selectIndent using Spaces
>2
, andReindent Lines
. This restores the 2 spaces formatting. But hitting save again turns the 2 spaces into 4.The text was updated successfully, but these errors were encountered: