mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-08 18:11:45 -06:00
conditionals are now introduce indentation scope
This commit is contained in:
parent
cd2016c48a
commit
30ada4cffe
@ -342,6 +342,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…
x
Reference in New Issue
Block a user