forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
getEditsForFileRename
: fix updateTsconfigFiles
w/ empty include
Avoid the assumption that there are always include patterns: when there are none (and therefore the renamed file didn't match anyway), just skip the test for added include. Also change the code to use `return` to make it flatter. (Also get rid of a redundant type.) Fixes microsoft#40386.
- Loading branch information
1 parent
c786ad4
commit 2b45d3b
Showing
2 changed files
with
25 additions
and
12 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
14 changes: 14 additions & 0 deletions
14
tests/cases/fourslash/getEditsForFileRename_tsconfig_empty_include.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,14 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
// @Filename: /a/foo.ts | ||
////const x = 1 | ||
|
||
// @Filename: /a/tsconfig.json | ||
////{ "include": [] } | ||
|
||
verify.getEditsForFileRename({ | ||
oldPath: "/a/foo.ts", | ||
newPath: "/a/bar.ts", | ||
newFileContents: { | ||
} | ||
}); |