TypeScript/tests/cases/fourslash/extract-method-uniqueName.ts
Andy 43bf039a94
Add refactor to convert namespace to named imports and back (#24469)
* Add refactor to convert namespace to named imports and back

* Add tests and comments

* Code review

* Handle shorthand property assignment and re-export

* Don't use forEachFreeIdentifier

* Fix rename after "."
2018-05-30 14:11:53 -07:00

20 lines
391 B
TypeScript

/// <reference path='fourslash.ts' />
////const newFunction = 0;
/////*start*/1 + 1/*end*/;
goTo.select('start', 'end')
edit.applyRefactor({
refactorName: "Extract Symbol",
actionName: "function_scope_0",
actionDescription: "Extract to function in global scope",
newContent:
`const newFunction = 0;
/*RENAME*/newFunction_1();
function newFunction_1() {
1 + 1;
}
`
});