editorconfig-vscode
editorconfig-vscode copied to clipboard
`indent_size` overrides `tab_width` for tab characters
Please fill-in this template.
- [x] I have a question that is specific to this extension; thus, inappropriate for the main EditorConfig issue tracker.
- [x] I tried running
code --disable-extensionsand the issue did NOT present itself.
Issue
| Visual Studio Code | editorconfig-vscode | |
|---|---|---|
| Version | 1.75.0-insider |
v0.16.4 |
Root .editorconfig File
root = true
[*]
tab_width = 4
[*.json]
indent_style = space
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 |
false |
____ |
files.autoSave |
"off" |
"___" |
"___" |
files.insertFinalNewline |
false |
true |
_____ |
files.trimTrailingWhitespace |
false |
_____ |
_____ |
File opened
./devcontainer.json
Expected behavior
- Indentation is selected as "Spaces: 2"
- Tab characters are rendered with a width of 4
Actual behavior
- Indentation is selected as "Spaces: 2"
- Tab characters are rendered with a width of 2
Additional comments or steps to reproduce
- Open a file with tab characters using the above configuration
- Observe the width of the tab characters
Note that there is a recent fix in VSCode itself: https://github.com/microsoft/vscode/pull/155450
Before this, VSCode was not able to distinguish tab and indent size, but it is now possible. indent_size should now be mapped to editor.indentSize in VSCode.
Related: https://github.com/editorconfig/editorconfig-vscode/issues/341