* 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 "."
18 lines
379 B
TypeScript
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;`,
|
|
});
|