Skip to content

Organize imports command doesn't respect tabSize/insertSpaces settings #4571

Description

@davidkarlsson

Extension Version

0.20260708.2

VS Code Version

1.128.0

Operating system Version

Microsoft Windows 11 Pro 10.0.26200 Build 26200

Steps to reproduce

  1. Set js/ts.experimental.useTsgo to true
  2. Set editor.tabSize to 2 and editor.insertSpaces to false or let editorconfig set them with indent_size and indent_style if you're using the EditorConfig extension
  3. Open a ts file containing a named import with multiple bindings that are spanning multiple rows
  4. Run the editor.action.organizeImports command

Issue

No matter what your tabSize and insertSpaces settings are set to the indentation for the named import bindings that spans multiple lines seems to indent them with 4 spaces.

When using TypeScript 7 as the formatter the editor.action.formatDocument command is using the settings correctly though so it only seem to use hard coded indent settings when organizing imports.

Metadata

Metadata

Labels

Domain: EditorRelated to the LSP server, editor experience

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions