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

Indent style and size are ignored for default (*) wildcard #343

Closed
3 tasks done
atipugin opened this issue Dec 12, 2022 · 4 comments
Closed
3 tasks done

Indent style and size are ignored for default (*) wildcard #343

atipugin opened this issue Dec 12, 2022 · 4 comments

Comments

@atipugin
Copy link

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.

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.

Issue

Visual Studio Code editorconfig-vscode
Version 1.74.0 0.16.4

Root .editorconfig File

root = true

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

Are there any other relevant .editorconfig files in your project? Yes / 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 _____ _____

File opened

./hello.md

Expected behavior

indent_size = 2

Actual behavior

indent_size = 4

Actually VSCode says following in status bar: Spaces: 4 (Tab Size: 2).

Additional comments or steps to reproduce

Tried to disable editor.detectIndentation - still no luck, VSCode keeps ignoring [*] settings and uses 4 spaces.

@rspcactucker
Copy link

I have this issue as well.

Here are the settings via CLI editorconfig :

$ editorconfig app/client/src/bundles/bundle.js 
charset=utf-8
end_of_line=lf
indent_size=2
indent_style=space
insert_final_newline=true
trim_trailing_whitespace=false
tab_width=2

And here is what VS Code is reporting:

image

For reference, here is my .editorconfig file:

root = true

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

[*.{json,php}]
indent_size = 4
indent_style = space

@atipugin
Copy link
Author

I think it might be related to #341 and microsoft/vscode#168836

@Macil
Copy link

Macil commented Dec 14, 2022

Yeah, I'm seeing this too. I have a project that has no .vscode indentation settings, and an .editorconfig specifying indent_style = space indent_size = 2 for all * files.

Previously, if you made a new file in the project, VSCode would show "Spaces: 2" in the status bar. Now it shows "Spaces: 4 (Tab Size: 2)", and indents to 4 spaces on tab key press. (If I remove the .editorconfig file, then it shows "Spaces: 4" instead. This shows that the .editorconfig is being recognized but isn't having the proper effect.)

@atipugin
Copy link
Author

atipugin commented Dec 15, 2022

VSCode team has just released 1.74.1 update and now problem is gone 🎉 Closing the issue.

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

3 participants