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

Space indent size is not working in VSCode version 1.74 #344

Closed
2 tasks done
mazeneko opened this issue Dec 14, 2022 · 3 comments
Closed
2 tasks done

Space indent size is not working in VSCode version 1.74 #344

mazeneko opened this issue Dec 14, 2022 · 3 comments

Comments

@mazeneko
Copy link

There is already a duplicate issue, but the title and description did not express the essence of the issue, so a new issue was created.

Also, the content of this issue was written based on this comment.

Task

  • 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.

Issue

Visual Studio Code editorconfig-vscode
Version 1.74.0 0.16.4

Root .editorconfig File

root = true

[*]
indent_style = space
indent_size = 2
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 _____ _____

Expected behavior

indent_style = space
indent_size = 2

Actual behavior

indent_style = space
indent_size = 4 #This means the current value of vscode

Reason

vscode has been updated to separate tabSize and indentSize in 1.74,
but editorconfig-vscode applies the indent_size option in .editorconfig only to vscode's tabSize,
and indentSize is This seems to be due to the fact that it has not been changed.

In the actual code, only the tabSize is generated here,

return {
...(config.indent_style === 'tab' ||
config.indent_size === 'tab' ||
config.indent_style === 'space'
? {
insertSpaces: config.indent_style === 'space',
}
: {}),
tabSize:
resolved.tabSize && resolved.tabSize >= 0
? resolved.tabSize
: defaults.tabSize,
}

and the vscode setting is changed here.

editor.options = newOptions

Also, I added the indentSize property in the debugger on this line and run it, and it was set as expected.

However, there is no indentSize in the TextEditorOptions type to actually change the code.

@mazeneko
Copy link
Author

The absence of indentSize in the TextEditorOptions type is discussed in this issue.

@ThexXTURBOXx
Copy link

This seems to be fixed in 1.74.1 now.

@STOWouters
Copy link

STOWouters commented Dec 14, 2022

This seems to be fixed in 1.74.1 now.

I concur. I reproduced the linked issues with VSCode 1.74.0 and 1.74.1 versions. The issue is present in 1.74.0 but is fixed in 1.74.1.

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