TypeScript/tests/cases/fourslash/refactorConvertImport_namespaceToNamed_namespaceUsed.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

18 lines
379 B
TypeScript

/// <reference path='fourslash.ts' />
/////*a*/import * as m from "m";/*b*/
////m.a;
////m;
goTo.select("a", "b");
edit.applyRefactor({
refactorName: "Convert import",
actionName: "Convert namespace import to named imports",
actionDescription: "Convert namespace import to named imports",
newContent:
`import * as m from "m";
import { a } from "m";
a;
m;`,
});