File tree Expand file tree Collapse file tree 3 files changed +39
-0
lines changed Expand file tree Collapse file tree 3 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -2370,6 +2370,7 @@ namespace ts {
23702370 writeLine ( ) ;
23712371 decreaseIndent ( ) ;
23722372 }
2373+ emitList ( node , node . members , ListFormat . PreserveLines ) ;
23732374 writePunctuation ( "}" ) ;
23742375 }
23752376
Original file line number Diff line number Diff line change 1+ /// <reference path='fourslash.ts' />
2+
3+ // @Filename : a.ts
4+ ////type Deep<T> = /*a*/{ [K in keyof T]: Deep<T[K]> }/*b*/
5+
6+ goTo . select ( "a" , "b" ) ;
7+ edit . applyRefactor ( {
8+ refactorName : "Extract type" ,
9+ actionName : "Extract to type alias" ,
10+ actionDescription : "Extract to type alias" ,
11+ newContent :
12+ `type /*RENAME*/NewType<T> = {
13+ [K in keyof T]: Deep<T[K]>;
14+ };
15+
16+ type Deep<T> = NewType<T>` ,
17+ } ) ;
Original file line number Diff line number Diff line change 1+ /// <reference path='fourslash.ts' />
2+
3+ // @Filename : a.ts
4+ ////type Expand<T> = T extends any
5+ //// ? /*a*/{ [K in keyof T]: Expand<T[K]> }/*b*/
6+ //// : never;
7+
8+ goTo . select ( "a" , "b" ) ;
9+ edit . applyRefactor ( {
10+ refactorName : "Extract type" ,
11+ actionName : "Extract to type alias" ,
12+ actionDescription : "Extract to type alias" ,
13+ newContent :
14+ `type /*RENAME*/NewType<T> = {
15+ [K in keyof T]: Expand<T[K]>;
16+ };
17+
18+ type Expand<T> = T extends any
19+ ? NewType<T>
20+ : never;` ,
21+ } ) ;
You can’t perform that action at this time.
0 commit comments