Merge pull request #4172 from hoanhtien/fixFormatOnChainedCallbacksIssue

Always indent PropertyAccessExpression.
This commit is contained in:
tien
2015-08-06 14:24:11 -07:00
2 changed files with 38 additions and 0 deletions
+1
View File
@@ -418,6 +418,7 @@ namespace ts.formatting {
case SyntaxKind.DefaultClause:
case SyntaxKind.CaseClause:
case SyntaxKind.ParenthesizedExpression:
case SyntaxKind.PropertyAccessExpression:
case SyntaxKind.CallExpression:
case SyntaxKind.NewExpression:
case SyntaxKind.VariableStatement:
@@ -0,0 +1,37 @@
/// <reference path='fourslash.ts'/>
////var x = 1;
////x
/////*1*/.toFixed
////x
/////*2*/.toFixed()
////x
/////*3*/.toFixed()
/////*4*/.length
/////*5*/.toString();
////x
/////*6*/.toFixed
/////*7*/.toString()
/////*8*/.length;
format.document();
goTo.marker('1');
verify.currentLineContentIs(' .toFixed');
goTo.marker('2');
verify.currentLineContentIs(' .toFixed()');
goTo.marker('3');
verify.currentLineContentIs(' .toFixed()');
goTo.marker('4');
verify.currentLineContentIs(' .length');
goTo.marker('5');
verify.currentLineContentIs(' .toString();');
goTo.marker('6');
verify.currentLineContentIs(' .toFixed');
goTo.marker('7');
verify.currentLineContentIs(' .toString()');
goTo.marker('8');
verify.currentLineContentIs(' .length;');