We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cd2016c commit 30ada4cCopy full SHA for 30ada4c
2 files changed
src/services/smartIndenter.ts
@@ -342,6 +342,7 @@ module ts.formatting {
342
case SyntaxKind.VariableDeclaration:
343
case SyntaxKind.ExportAssignment:
344
case SyntaxKind.ReturnStatement:
345
+ case SyntaxKind.ConditionalExpression:
346
return true;
347
}
348
return false;
tests/cases/fourslash/formattingConditionals.ts
@@ -0,0 +1,23 @@
1
+/// <reference path='fourslash.ts' />
2
+
3
4
+////var v =
5
+/////*0*/a === b
6
+/////*1*/? c
7
+/////*2*/: d;
8
9
+////var v = a === b
10
+/////*3*/? c
11
+/////*4*/: d;
12
13
+function verifyLine(marker: string, content: string) {
14
+ goTo.marker(marker);
15
+ verify.currentLineContentIs(content);
16
+}
17
18
+format.document();
19
+verifyLine("0", " a === b");
20
+verifyLine("1", " ? c");
21
+verifyLine("2", " : d;");
22
+verifyLine("3", " ? c");
23
+verifyLine("4", " : d;");
0 commit comments