parent
05d59a1f1a
commit
29cf049e61
|
@ -533,6 +533,7 @@ namespace ts.refactor {
|
||||||
case SyntaxKind.ImportEqualsDeclaration:
|
case SyntaxKind.ImportEqualsDeclaration:
|
||||||
case SyntaxKind.ImportSpecifier:
|
case SyntaxKind.ImportSpecifier:
|
||||||
case SyntaxKind.ImportClause:
|
case SyntaxKind.ImportClause:
|
||||||
|
case SyntaxKind.NamespaceImport:
|
||||||
return true;
|
return true;
|
||||||
case SyntaxKind.VariableDeclaration:
|
case SyntaxKind.VariableDeclaration:
|
||||||
return isVariableDeclarationInImport(decl as VariableDeclaration);
|
return isVariableDeclarationInImport(decl as VariableDeclaration);
|
||||||
|
|
18
tests/cases/fourslash/moveToNewFile_moveNamedImport.ts
Normal file
18
tests/cases/fourslash/moveToNewFile_moveNamedImport.ts
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
/// <reference path='fourslash.ts' />
|
||||||
|
|
||||||
|
// @Filename: /a.ts
|
||||||
|
////import { foo as oFoo } from './other';
|
||||||
|
////[|export const x = oFoo();|]
|
||||||
|
////export const a = 0;
|
||||||
|
|
||||||
|
verify.moveToNewFile({
|
||||||
|
newFileContents: {
|
||||||
|
"/a.ts":
|
||||||
|
`export const a = 0;`,
|
||||||
|
|
||||||
|
"/x.ts":
|
||||||
|
`import { foo as oFoo } from './other';
|
||||||
|
export const x = oFoo();
|
||||||
|
`
|
||||||
|
},
|
||||||
|
});
|
18
tests/cases/fourslash/moveToNewFile_moveNamespaceImport.ts
Normal file
18
tests/cases/fourslash/moveToNewFile_moveNamespaceImport.ts
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
/// <reference path='fourslash.ts' />
|
||||||
|
|
||||||
|
// @Filename: /a.ts
|
||||||
|
////import * as o from './other';
|
||||||
|
////[|export const x = o.foo();|]
|
||||||
|
////export const a = 0;
|
||||||
|
|
||||||
|
verify.moveToNewFile({
|
||||||
|
newFileContents: {
|
||||||
|
"/a.ts":
|
||||||
|
`export const a = 0;`,
|
||||||
|
|
||||||
|
"/x.ts":
|
||||||
|
`import * as o from './other';
|
||||||
|
export const x = o.foo();
|
||||||
|
`
|
||||||
|
},
|
||||||
|
});
|
Loading…
Reference in a new issue