Skip to content

Commit 2d0b00f

Browse files
committed
Merge pull request #7055 from Microsoft/port7042
Fixed watcher for rename operations, and for allowJs in config file
2 parents bf23488 + cc76f0f commit 2d0b00f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/compiler/sys.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,8 @@ namespace ts {
378378
const filePath = typeof relativeFileName !== "string"
379379
? undefined
380380
: toPath(relativeFileName, baseDirPath, createGetCanonicalFileName(sys.useCaseSensitiveFileNames));
381-
if (eventName === "change" && fileWatcherCallbacks.contains(filePath)) {
381+
// Some applications save a working file via rename operations
382+
if ((eventName === "change" || eventName === "rename") && fileWatcherCallbacks.contains(filePath)) {
382383
for (const fileCallback of fileWatcherCallbacks.get(filePath)) {
383384
fileCallback(filePath);
384385
}

src/compiler/tsc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ namespace ts {
486486
}
487487

488488
function watchedDirectoryChanged(fileName: string) {
489-
if (fileName && !ts.isSupportedSourceFileName(fileName, commandLine.options)) {
489+
if (fileName && !ts.isSupportedSourceFileName(fileName, compilerOptions)) {
490490
return;
491491
}
492492

0 commit comments

Comments
 (0)