3eea1a9e9a
Major changes: 1) Instead of skipping undesirable scopes, include them and mark them with errors. Constants can be extracted into more scopes. 2) Update the tests to call through the "public" API. This caused some baseline changes. 3) Rename refactoring to "Extract Symbol" for generality. 4) Return a second ApplicableRefactorInfo for constants. Distinguish the two by splitting the action name.
18 lines
482 B
TypeScript
18 lines
482 B
TypeScript
/// <reference path='fourslash.ts' />
|
|
|
|
//// namespace NS {
|
|
//// class Q {
|
|
//// foo() {
|
|
//// console.log('100');
|
|
//// const m = 10, j = "hello", k = {x: "what"};
|
|
//// const q = /*a*/m/*b*/;
|
|
//// }
|
|
//// }
|
|
//// }
|
|
|
|
// Don't offer to 'extract symbol' a single identifier
|
|
|
|
goTo.marker('a');
|
|
verify.not.refactorAvailable('Extract Symbol');
|
|
goTo.select('a', 'b');
|
|
verify.not.refactorAvailable('Extract Symbol');
|