List position based formatting#13574
Conversation
| if ((<TypeReferenceNode>node).typeArguments === list) { | ||
| return SyntaxKind.LessThanToken; | ||
| } | ||
| case SyntaxKind.TypeLiteral: |
There was a problem hiding this comment.
Is this an intended fallthrough?
| */ | ||
| interface DynamicIndentation { | ||
| getIndentationForToken(tokenLine: number, tokenKind: SyntaxKind, container: Node): number; | ||
| getIndentationForToken(tokenLine: number, tokenKind: SyntaxKind, container: Node, suppressDelta: boolean): number; |
There was a problem hiding this comment.
Can you add a comment for the "suppressDelta" parameter, including examples of when would that be set to true? So it would be easier to read
| consumeTokenAndAdvanceScanner(tokenInfo, parent, parentDynamicIndentation, parent); | ||
|
|
||
| if (indentationOnLastIndentedLine !== Constants.Unknown) { | ||
| indentationOnListStartToken = indentationOnLastIndentedLine; |
There was a problem hiding this comment.
Can you add a comment here explaining the relationship between indentationOnLastIndentedLine and indentationOnListStartToken? It looks like they are related somehow
|
Test fails on codeFixClassImplementInterfaceComputedPropertyNameWellKnownSymbols because of a strange NodeArray object with the form |
|
BTW I think the fix for codeFixClassImplementInterfaceComputedPropertyNameWellKnownSymbols is out of scope of this PR, a simple workaround may be enough? |
... and add explicit delta suppressor for list end tokens
|
Rebased and squashed for easier review. Sorry for previous mess 😅 |
|
What is the status of this PR? |
|
I think it's mature enough, time to merge conflicts anyway... |
|
Thanks for your contribution. This PR has not been updated in a while and cannot be automatically merged at the time being. For housekeeping purposes we are closing stale PRs. If you'd still like to continue working on this PR, please leave a message and one of the maintainers can reopen it. |
|
@Andy-MS can you refresh this PR |
|
Note for myself: downgrade to TS 2.4.x, gulp-typescript 3.0.x, and mocha 3.5.x to build this. |
Solved by #18284 |
Fixes #5830, fixes #5890, fixes #6252, fixes #6320, fixes #6451, fixes #10681, fixes #13688, and maybe more.
Previous behavior:
New behavior: