File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -409,6 +409,7 @@ namespace ts.formatting {
409
409
switch ( context . contextNode . kind ) {
410
410
case SyntaxKind . BinaryExpression :
411
411
case SyntaxKind . ConditionalExpression :
412
+ case SyntaxKind . ConditionalType :
412
413
case SyntaxKind . AsExpression :
413
414
case SyntaxKind . ExportSpecifier :
414
415
case SyntaxKind . ImportSpecifier :
@@ -461,7 +462,8 @@ namespace ts.formatting {
461
462
}
462
463
463
464
function isConditionalOperatorContext ( context : FormattingContext ) : boolean {
464
- return context . contextNode . kind === SyntaxKind . ConditionalExpression ;
465
+ return context . contextNode . kind === SyntaxKind . ConditionalExpression ||
466
+ context . contextNode . kind === SyntaxKind . ConditionalType ;
465
467
}
466
468
467
469
function isSameLineTokenOrBeforeBlockContext ( context : FormattingContext ) : boolean {
Original file line number Diff line number Diff line change 3
3
////var x=true?1:2
4
4
format . document ( ) ;
5
5
goTo . bof ( ) ;
6
- verify . currentLineContentIs ( "var x = true ? 1 : 2" ) ; ;
6
+ verify . currentLineContentIs ( "var x = true ? 1 : 2" ) ;
Original file line number Diff line number Diff line change
1
+ /// <reference path='fourslash.ts'/>
2
+
3
+ /////*L1*/type Diff1<T, U> = T extends U?never:T;
4
+ /////*L2*/type Diff2<T, U> = T extends U ? never : T;
5
+
6
+ format . document ( ) ;
7
+
8
+ goTo . marker ( "L1" ) ;
9
+ verify . currentLineContentIs ( "type Diff1<T, U> = T extends U ? never : T;" ) ;
10
+
11
+ goTo . marker ( "L2" ) ;
12
+ verify . currentLineContentIs ( "type Diff2<T, U> = T extends U ? never : T;" ) ;
You can’t perform that action at this time.
0 commit comments