1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
/// <reference path="../fourslash.ts" />
//// function foo(): void { /*x*/console.log('a');/*y*/ }
goTo.select("x","y");
verify.refactorAvailable("Extract Symbol", 'function_scope_0', "Extract to inner function in function 'foo'");
verify.refactorAvailable("Extract Symbol", 'function_scope_1', "Extract to function in global scope");
verify.not.refactorAvailable("Extract Symbol", 'constant_scope_0', "Extract to inner function in function 'foo'");
verify.refactorAvailable("Extract Symbol", 'constant_scope_0', "Extract to constant in enclosing scope");
verify.refactorAvailable("Extract Symbol", 'constant_scope_1', "Extract to constant in global scope");
verify.not.refactorAvailable("Extract Symbol", 'constant_scope_0', "Extract to constant in global scope");
|