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

Indentation detection doesn't work with 3-spaces #17639

Closed
jiggak opened this issue Dec 21, 2016 · 4 comments
Closed

Indentation detection doesn't work with 3-spaces #17639

jiggak opened this issue Dec 21, 2016 · 4 comments
Labels
editor-core Editor basic functionality feature-request Request for new features or functionality
Milestone

Comments

@jiggak
Copy link

jiggak commented Dec 21, 2016

  • VSCode Version: 1.8.1
  • OS Version: any

Steps to Reproduce:

  1. Set the following settings:
{
   "editor.tabSize": 3,
   "editor.insertSpaces": true,
   "editor.detectIndentation": true
}
  1. Open source file that uses 3-space indentation
  2. Notice guessed indentation is not 3-spaces (typically guesses 4)

After attempting to debug this it became clear pretty quickly. The indentationGuesser is designed to work with 2, 4, 6, and 8 spaces.

So is it feasible to make the indentation guesser work with odd-number space indentation? If not there should probably be something somewhere to tell you the indent detection only works with 2, 4, 6, 8 spaces.

@jiggak
Copy link
Author

jiggak commented Dec 21, 2016

After being more conscience of this issue while working with my code base I noticed sometimes files with 3-space indent do infact have correct indent settings, despite what I described in the issue description.

Here is a source file that consistently opens with incorrect indent settings for testing.

https://gist.github.com/jiggak/ebe980e4cd209381f2b8c0f8f922344c

@alexdima alexdima added feature-request Request for new features or functionality editor-core Editor basic functionality labels Mar 2, 2017
@alexdima alexdima added this to the Backlog milestone Mar 2, 2017
@alexdima alexdima removed their assignment Mar 2, 2017
@kscharlund
Copy link
Contributor

I'm also encountering this problem regularly, would love for it to be fixed.

@holive
Copy link

holive commented Jan 5, 2018

I'm encountering this problem too..

@nycki93
Copy link

nycki93 commented Aug 9, 2018

Happening for me in JavaScript. I set tabs to 3 spaces, and let VSCode auto-format the whole file. Then I set tabs to auto-detect, and it detected 4 spaces. Something's screwy.

alexdima added a commit that referenced this issue Oct 9, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor-core Editor basic functionality feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

5 participants