-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moveToNewFile: fix quotes for module specifiers (#60203)
- Loading branch information
Showing
5 changed files
with
48 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/// <reference path='fourslash.ts' /> | ||
|
||
// @Filename: /a.ts | ||
////export const x = 0; | ||
////x; | ||
|
||
// @Filename: /b.ts | ||
////import { x } from './a' | ||
//// | ||
////[|x|]; | ||
|
||
|
||
verify.moveToNewFile({ | ||
newFileContents: { | ||
"/newFile.ts": // module specifier should have the same quotes as import in the original file | ||
`import { x } from './a'; | ||
x; | ||
`, | ||
"/b.ts": | ||
` | ||
` | ||
}, | ||
}); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/// <reference path='fourslash.ts' /> | ||
|
||
// @Filename: /other.ts | ||
//// export function foo() { return 1 }; | ||
|
||
// @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(); | ||
` | ||
}, | ||
}); |