conditionals are now introduce indentation scope
This commit is contained in:
parent
87b7ddd51b
commit
59a31acca1
2 changed files with 24 additions and 0 deletions
|
@ -341,6 +341,7 @@ module ts.formatting {
|
|||
case SyntaxKind.VariableDeclaration:
|
||||
case SyntaxKind.ExportAssignment:
|
||||
case SyntaxKind.ReturnStatement:
|
||||
case SyntaxKind.ConditionalExpression:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
23
tests/cases/fourslash/formattingConditionals.ts
Normal file
23
tests/cases/fourslash/formattingConditionals.ts
Normal file
|
@ -0,0 +1,23 @@
|
|||
/// <reference path='fourslash.ts' />
|
||||
|
||||
|
||||
////var v =
|
||||
/////*0*/a === b
|
||||
/////*1*/? c
|
||||
/////*2*/: d;
|
||||
|
||||
////var v = a === b
|
||||
/////*3*/? c
|
||||
/////*4*/: d;
|
||||
|
||||
function verifyLine(marker: string, content: string) {
|
||||
goTo.marker(marker);
|
||||
verify.currentLineContentIs(content);
|
||||
}
|
||||
|
||||
format.document();
|
||||
verifyLine("0", " a === b");
|
||||
verifyLine("1", " ? c");
|
||||
verifyLine("2", " : d;");
|
||||
verifyLine("3", " ? c");
|
||||
verifyLine("4", " : d;");
|
Loading…
Reference in a new issue