Skip to content
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

Editor indentation autodetection not working and manually set indentation keeps getting reset #6447

Closed
mschuckmann opened this issue May 17, 2016 · 3 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@mschuckmann
Copy link

  • VSCode Version:1.1.1
  • OS Version: Ubuntu 15.10 64bit

Steps to Reproduce:

  1. User settings set like so:
    "editor.tabSize": 2,
    "editor.insertSpaces": true,
    "editor.detectIndentation":true,
  2. Open a C/C++ project with 4 space indentation.
  3. Open a file in the project, observe on the status bar Spaces:2 (expected: Spaces: 4)
  4. Click on the Spaces:2 setting in the status bar and select "Detect Indentation from Content".
  5. Observe that the status bar now says Spaces: 4.
  6. Switch to a different file with indentation of 4 spaces, it doesn't seem to matter.
  7. Observe that the status bar now say Spaces: 2 (expected: Spaces: 4)
  8. Switch back to the original file, observe that the status bar still stays Spaces: 2 (expected: spaces 4)

I've seen similar behavior with Makefiles and tabs, I manually switch to tab mode and every time I toggle back and forth from another file the tab mode is reset to spaces.

lance added a commit to lance/vscode that referenced this issue May 19, 2016
@alexdima
Copy link
Member

alexdima commented May 23, 2016

@mschuckmann From what you are describing, it seems that "Detect Indentation from Content" does the right thing (i.e. guesses spaces@4 when the file contains mostly spaces@4), but it also appears that "Detect Indentation from Content" is not executing or is being overwritten.

The user settings can be overwritten by workspace settings (does the folder you open define .vscode settings?) and can be overwritten by extensions (do you perhaps have installed an extension that might do something with the indentation settings -- easiest is to check if the issue reproduces after closing all VSCode instances and running vscode --disable-extensions).

@alexdima alexdima added the info-needed Issue requires more information from poster label May 23, 2016
@mschuckmann
Copy link
Author

So running vscode with --disable-extensions does appear to fix the problem.
And it appears that the culprit was the EditorConfig for VS Studio extension.

Thank you for the suggestion.

@alexdima
Copy link
Member

Cool, just look in your system for an .editorconfig file somewhere in your parent directories or in your user folder, most likely settings are being picked up from there.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants