File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /// <reference path='fourslash.ts' />
2+
3+ // Repro https://github.com/Microsoft/TypeScript/issues/19395
4+
5+ // @Filename : test.ts
6+ //// export const b = 2;
7+ //// interface Interface { }
8+ ////
9+ //// async function handle(i: Interface) {
10+ //// /*a*/const x = 3, y = i;/*b*/
11+ //// }
12+ // @Filename : library.d.ts
13+ //// export as namespace NS;
14+ //// export const a = 1;
15+
16+
17+ goTo . select ( 'a' , 'b' )
18+ edit . applyRefactor ( {
19+ refactorName : "Extract Symbol" ,
20+ actionName : "function_scope_1" ,
21+ actionDescription : "Extract to function in module scope" ,
22+ newContent :
23+ `export const b = 2;
24+ interface Interface { }
25+
26+ async function handle(i: Interface) {
27+ /*RENAME*/newFunction(i);
28+ }
29+
30+ function newFunction(i: Interface) {
31+ const x = 3, y = i;
32+ }
33+ `
34+ } ) ;
You can’t perform that action at this time.
0 commit comments