Formatter is broken when using tabs #12175
Labels
Bug
A bug in TypeScript
Fixed
A PR has been merged for this issue
VS Code Tracked
There is a VS Code equivalent to this issue
Milestone
TypeScript Version: 2.0.8
In VS Code I have configured tabs to be 2 characters wide (
"editor.tabSize": 2
). I noticed that some lines of code are incorrectly ignored by the formatter when using this setting.For example, the formatter should outdent line two in the following snippet to 1 tab only, which initially has 2 tabs, and it fails to do so:
Any other indentation on that line makes the formatter behave properly and format it with a single tab. It's only when using 2 tabs that it stays put.
It feels like the tab size is incorrectly taken into account when indenting using tabs, when it should simply be ignored. This is confirmed by setting
tabSize
to 3 and indenting line two with 3 tabs: the formatter will ignore that line. It also reproduces withtabSize
of 4 (default) and indenting line two with 4 tabs. And so on...cc @jrieken
The text was updated successfully, but these errors were encountered: