Skip to content

Commit d1fa06e

Browse files
committed
Type is referenced from context where it's not visible
1 parent dd484df commit d1fa06e

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

Diff for: tests/cases/fourslash/extract-method24.ts

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/// <reference path='fourslash.ts' />
2+
3+
//// function foo() {
4+
//// type T = {};
5+
//// let x: T = /*start*/{}/*end*/;
6+
//// }
7+
8+
goTo.select('start', 'end')
9+
10+
verify.refactorAvailable('Extract Method');
11+
12+
edit.applyRefactor('Extract Method', "scope_1");
13+
14+
verify.currentFileContentIs(`function foo() {
15+
type T = {};
16+
let x: T = newFunction();
17+
}
18+
function newFunction(): {} {
19+
return {};
20+
}
21+
`);
22+
23+
// Actual: "function·foo()·{↓
24+
// ····type·T·=·{};↓
25+
// ····let·x:·T·=·newFunction();↓
26+
// }¶↓
27+
// function·newFunction():·T·{¶↓
28+
// ····return·{};¶↓
29+
// }¶↓
30+
// "

0 commit comments

Comments
 (0)