Skip to content

Explore using formatters for indentation adjustment when formatters are available #19847

@borekb

Description

@borekb

VSCode 1.9 introduced initial support for line indenting as per the release notes, I think it's this commit: be1b5f7. I'm very interested in this feature, big 👍 for bringing it into VSCode.

Here is some initial feedback:

  • I tried for a couple of file formats, it only worked for TypeScript and not e.g., for JSON or PHP.
  • Formatting (Alt+Shift+F) can already do indentation better than the new implementation, maybe it could be used as a fallback if the language doesn't have proper indentation rules.
  • If I read the code correctly, it re-indents the whole file. It should respect my selection. For example, if I have only 10 lines selected, it should re-indent those. If I don't have any selection, it should do the whole file.
  • The command is currently editor.action.reindentlines, proper casing would be editor.action.reindentLines.

Metadata

Metadata

Assignees

Labels

editor-autoindentEditor auto indentation issuesunder-discussionIssue is under discussion for relevance, priority, approach

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions