Skip to content

Commit ea3eb01

Browse files
committed
Merge pull request microsoft#4172 from hoanhtien/fixFormatOnChainedCallbacksIssue
Always indent PropertyAccessExpression.
2 parents 2b8ef5e + 1cc0e5f commit ea3eb01

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

src/services/formatting/smartIndenter.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ namespace ts.formatting {
418418
case SyntaxKind.DefaultClause:
419419
case SyntaxKind.CaseClause:
420420
case SyntaxKind.ParenthesizedExpression:
421+
case SyntaxKind.PropertyAccessExpression:
421422
case SyntaxKind.CallExpression:
422423
case SyntaxKind.NewExpression:
423424
case SyntaxKind.VariableStatement:
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/// <reference path='fourslash.ts'/>
2+
3+
////var x = 1;
4+
5+
////x
6+
/////*1*/.toFixed
7+
8+
////x
9+
/////*2*/.toFixed()
10+
11+
////x
12+
/////*3*/.toFixed()
13+
/////*4*/.length
14+
/////*5*/.toString();
15+
16+
////x
17+
/////*6*/.toFixed
18+
/////*7*/.toString()
19+
/////*8*/.length;
20+
21+
format.document();
22+
goTo.marker('1');
23+
verify.currentLineContentIs(' .toFixed');
24+
goTo.marker('2');
25+
verify.currentLineContentIs(' .toFixed()');
26+
goTo.marker('3');
27+
verify.currentLineContentIs(' .toFixed()');
28+
goTo.marker('4');
29+
verify.currentLineContentIs(' .length');
30+
goTo.marker('5');
31+
verify.currentLineContentIs(' .toString();');
32+
goTo.marker('6');
33+
verify.currentLineContentIs(' .toFixed');
34+
goTo.marker('7');
35+
verify.currentLineContentIs(' .toString()');
36+
goTo.marker('8');
37+
verify.currentLineContentIs(' .length;');

0 commit comments

Comments
 (0)