forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry-pick PR microsoft#54358 into release-5.1
Component commits: 062fdfd don't use text change's create new file for existing empty file 9176b4a minor fixes d1d9174 fix suffix newline 3dd77cf fix import
- Loading branch information
1 parent
cede745
commit 6d6051b
Showing
9 changed files
with
104 additions
and
15 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
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
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
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
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
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
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
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
27 changes: 27 additions & 0 deletions
27
tests/cases/fourslash/server/moveToFile_emptyTargetFile.ts
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,27 @@ | ||
/// <reference path='../fourslash.ts' /> | ||
|
||
// @Filename: /source.ts | ||
////[|export const a = 1;|] | ||
////const b = 2; | ||
////console.log(a, b); | ||
|
||
// @Filename: /target.ts | ||
/////** empty */ | ||
|
||
// @Filename: /tsconfig.json | ||
///// { "compilerOptions": { "newLine": "lf" } } | ||
|
||
verify.moveToFile({ | ||
newFileContents: { | ||
"/source.ts": | ||
`import { a } from "./target"; | ||
const b = 2; | ||
console.log(a, b);`, | ||
"/target.ts": | ||
`/** empty */ | ||
export const a = 1; | ||
`, | ||
}, | ||
interactiveRefactorArguments: { targetFile: "/target.ts" }, | ||
}); |