-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
VSCODE onFormatSave inserting custom spaces and not detecting indentation #17079
Comments
@basickarl thank you for opening this issue and for the impeccable detail! I believe this is a duplicate of microsoft/TypeScript#10335 |
I do not think this is a duplicate, I am suffering the same issue and it really is a PITA... I have been using Code for several years, and suddenly today this thing happens. Every time I save a modified file all the code is automatically indented to 4 spaces, even if the settings is explicitly set to 2 spaces, and also, why would the code be reformatted when saving? I don't want that... My user settings:
I am having the same issue when editing javascript or java... Code version 1.8.1 |
workaround for me was to roll back to code 1.5.3. |
@manast I'll try a rollback and get back, see if it works. |
@waderyan I checked the other issue and it's not related. We don't use TypeScript and the issue isn't affecting consistency. The formatting is consistent but it inserts 4 spaces instead of 2. |
@basickarl understood. Thank you for investigating further. My mistake. Let me take a look at it again. |
@waderyan No worries! Just ask if you need any information about my setup/build! This affects me on both my laptops I must add. Both are running Linux (Ubuntu 16.04 [as stated above] and ElementaryOS Freya [which itself is based off of Ubuntu 14.04]) |
@basickarl Are you still running into this issue with the latest VSCode release? If you are, please try collecting the TypeScript server log:
TypeScript powers both our JavaScript and TypeScript language features and provides document formatting functionality |
@mjbvz I'll have a look into it! |
Closing this out. If anyone is still running into this issue on the latest VS Code insiders builds, please open a new issue and I will take a look |
As a complementary note, I managed to resolve my issue removing all config directories of VSCode in my mac, such as ~.vscode. After that the issue disappeared. Maybe some setting from version 1.5.3 that was incompatible with newer versions. |
Linux lnxkarlm 4.4.0-45-generic Git conflict highlighting can get messed up easily #66-Ubuntu SMP Wed Oct 19 14:12:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Steps to Reproduce: I have no idea but I'll give you how the project is setup.
My issue is that vscode is automatically inserting 4 spaces into my code with formatOnSave when I open a new file which is already indented with 2 spaces.
settings.json
working space:
My files otherwise run on eslint with the following .eslintrc file:
I tried turning eslint off but the problem persists.
How do i fix this? I first click on "Indent Using spaces" and choose "3". I then edit the file and save, this fixes the spacing from 4 to 3. Then I redo the step and select "2", edit and save and the file then rejumps to 2 spaces.
It states that my tab is set to 4 spaces.
I don't understand as I have auto indentation set to true. Rest of the people in my project do not have any issues. Then again, none of them are using vscode.
Anymore info? Please ask!
The text was updated successfully, but these errors were encountered: