editorconfig-vscode icon indicating copy to clipboard operation
editorconfig-vscode copied to clipboard

`indent_size` overrides `tab_width` for tab characters

Open RA80533 opened this issue 2 years ago • 4 comments

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-extensions and 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

RA80533 avatar Jan 25 '23 21:01 RA80533

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.

moy avatar Jul 21 '23 14:07 moy

Related: https://github.com/editorconfig/editorconfig-vscode/issues/341

huyz avatar Apr 04 '24 08:04 huyz