-
Notifications
You must be signed in to change notification settings - Fork 28
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
[ts] wrong indentation when pressing enter on a very eagerly wrapped assignment line #186
Comments
That's not how the indentation currently works—it'll indent once per statement, not for every newline in the statement. I'm not quite sure how the behavior you are expecting would work. |
I think we'd discussed a similar issue in #124 (though we use one formatter for Java and a different one for C++/JS/TS). Both of the following are produced by the formatter depending on external constraints (e.g. how close the 80 column ruler is): const foo = new Bar()
.baz()
.quux();
const foo =
new Bar()
.baz()
.quux(); In both cases, the rule is that the wrapped element gets a +4 indent relative to the column that started the element at the same syntactic level. There are two such syntactic levels here, the outer one is the assignment statement and the inner one on the right is the |
This appears to be different from #124. I've added a special case for wrapped method calls under a But I want to make a note that this is the last extra indentation behavior I'm prepared to add. Of course I'll continue to respond to reports of obviously bad indentation, but given that no real requirements were provided for the indentation, and this is turning into 'the tool must do whatever some other tool happens to do', I can't keep adding new behavior (indentation is relatively tricky to get right, so this is turning into a bit of a time drain). |
if you press enter at the end of the last line, cursor goes to column 4, when it should go to column 8 since it's wrapping again
The text was updated successfully, but these errors were encountered: