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

.editorconfig is picking up incorrect indentation #145

Closed
2 of 3 tasks
bmacnaughton opened this issue Apr 11, 2017 · 5 comments
Closed
2 of 3 tasks

.editorconfig is picking up incorrect indentation #145

bmacnaughton opened this issue Apr 11, 2017 · 5 comments

Comments

@bmacnaughton
Copy link

bmacnaughton commented Apr 11, 2017

Please fill-in this template.

  • I have a question that is specific to this extension; thus, inappropriate for the main EditorConfig issue tracker.
  • I tried running code --disable-extensions and the issue did NOT present itself.
    If I disable extensions then .editorconfig won't be active and it should use default tab settings.

Delete the following condition if it doesn't apply to your case:

If the extension is not picking up the expected configuration for a file:

  • I tried npm install editorconfig -g and ran editorconfig [file-in-question] and the configuration was what I expected. If not, please file on the editorconfig-core-js issue tracker.

Output was:

charset=utf-8
indent_style=space
indent_size=2
end_of_line=lf
insert_final_newline=true
trim_trailing_whitespace=true
tab_width=2

Issue

Visual Studio Code editorconfig-vscode
Version 1.11.1 0.9.2

Root .editorconfig File

root = true

[*]
charset = utf-8
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{js,vue,scss}]
indent_size = 2

Are there any other relevant .editorconfig files in your project? No

Visual Studio Code Setting Default User Workspace
editor.insertSpaces true ____ ____
editor.tabSize 4 _ _
editor.trimAutoWhitespace true ____ ____
files.autoSave "off" "___" "___"
files.insertFinalNewline false _____ _____
files.trimTrailingWhitespace false true _____
editor.detectIndentation true false _____

File opened

./src/components/lmd-app.vue

Expected behavior

indent_size = 2

Actual behavior

indent_size = 4

Editor config is clearly loading - it's in the Output window.

Here's the log from it:

Initializing document watcher...
Rebuilding config map...
extension-output-#2.testOutput: Using EditorConfig core...
/home/bruce/ds/lmd/.editorconfig: Using EditorConfig core...
Detected change in configuration: {"tabSize":4,"insertSpaces":true}
/home/bruce/ds/lmd/.editorconfig: {"insertSpaces":true,"tabSize":4}
/home/bruce/ds/lmd/.editorconfig: {"insertSpaces":true,"tabSize":4}
extension-output-#2.testOutput: Applying configuration map...
extension-output-#2: {"insertSpaces":true,"tabSize":4}
/home/bruce/ds/lmd/.editorconfig: Applying configuration map...
/home/bruce/ds/lmd/.editorconfig: {"insertSpaces":true,"tabSize":4}
extension-output-#2.testOutput: Applying configuration map...
extension-output-#2: {"insertSpaces":true,"tabSize":4}

It just added these lines

/home/bruce/ds/lmd/.editorconfig: Applying configuration map...
/home/bruce/ds/lmd/.editorconfig: {"insertSpaces":true,"tabSize":4}

Then these

extension-output-#2.testOutput: Applying configuration map...
extension-output-#2: {"insertSpaces":true,"tabSize":4}

I don't know that it matters but I run two different instantiations of vscode both with the same directory root.

@jednano
Copy link
Member

jednano commented Apr 11, 2017

@bmacnaughton are you actually opening the lmd-app.vue file? Because the EditorConfig output window doesn't seem to detect the opening of that file at all.

I've recreated your project structure on Windows 10 and I'm seeing the following:

.editorconfig: Applying configuration map...
.editorconfig: {"insertSpaces":true,"tabSize":4}
src/components/lmd-app.vue: Applying configuration map...
src/components/lmd-app.vue: {"insertSpaces":true,"tabSize":2}

jednano added a commit to jednano/editorconfig-vscode that referenced this issue Apr 11, 2017
jednano pushed a commit that referenced this issue Apr 11, 2017
v0.9.3: Fix workspace issue on Linux #145
@jednano
Copy link
Member

jednano commented Apr 11, 2017

@bmacnaughton thanks so much for the details! I think I found and fixed the issue, but please let me know if it's still a problem in v0.9.3.

@bmacnaughton
Copy link
Author

bmacnaughton commented Apr 12, 2017

are you actually opening the lmd-app.vue file?

Well, I haven't in quite a while; it's been opened by vscode saving the state. But I have opened multiple .vue files that it hasn't picked up the config for.

@jednano
Copy link
Member

jednano commented Apr 12, 2017

What about now? Version 0.9.3?

@bmacnaughton
Copy link
Author

bmacnaughton commented Apr 12, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants