conditionals are now introduce indentation scope

This commit is contained in:
Vladimir Matveev 2014-12-10 14:03:14 -08:00
parent 87b7ddd51b
commit 59a31acca1
2 changed files with 24 additions and 0 deletions

View file

@ -341,6 +341,7 @@ module ts.formatting {
case SyntaxKind.VariableDeclaration:
case SyntaxKind.ExportAssignment:
case SyntaxKind.ReturnStatement:
case SyntaxKind.ConditionalExpression:
return true;
}
return false;

View 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;");