Skip to content

Commit d8aafee

Browse files
committed
Add regression test for microsoft#19395
Thanks to @mjbvz for finding it and @sandersn for reducing it.
1 parent 505ffab commit d8aafee

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
});

0 commit comments

Comments
 (0)