File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -342,6 +342,7 @@ module ts.formatting {
342342 case SyntaxKind . VariableDeclaration :
343343 case SyntaxKind . ExportAssignment :
344344 case SyntaxKind . ReturnStatement :
345+ case SyntaxKind . ConditionalExpression :
345346 return true ;
346347 }
347348 return false ;
Original file line number Diff line number Diff line change 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+ ////var x =
14+ /////*5*/a
15+ /////*6*/? function(){
16+ /////*7*/var z = 1
17+ /////*8*/ }
18+ /////*9*/: function(){
19+ /////*10*/var z = 2
20+ /////*11*/ }
21+
22+
23+
24+
25+ function verifyLine ( marker : string , content : string ) {
26+ goTo . marker ( marker ) ;
27+ verify . currentLineContentIs ( content ) ;
28+ }
29+
30+ format . document ( ) ;
31+ verifyLine ( "0" , " a === b" ) ;
32+ verifyLine ( "1" , " ? c" ) ;
33+ verifyLine ( "2" , " : d;" ) ;
34+
35+ verifyLine ( "3" , " ? c" ) ;
36+ verifyLine ( "4" , " : d;" ) ;
37+
38+ verifyLine ( "5" , " a" ) ;
39+ verifyLine ( "6" , " ? function() {" ) ;
40+ verifyLine ( "7" , " var z = 1" ) ;
41+ verifyLine ( "8" , " }" ) ;
42+ verifyLine ( "9" , " : function() {" ) ;
43+ verifyLine ( "10" , " var z = 2" ) ;
44+ verifyLine ( "11" , " }" ) ;
You can’t perform that action at this time.
0 commit comments