Skip to content

Commit 745f32b

Browse files
committed
Fixed watcher for rename operations, and for allowJs in config file
1 parent d5538f0 commit 745f32b

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
@@ -381,7 +381,8 @@ namespace ts {
381381
const filePath = typeof relativeFileName !== "string"
382382
? undefined
383383
: toPath(relativeFileName, baseDirPath, createGetCanonicalFileName(sys.useCaseSensitiveFileNames));
384-
if (eventName === "change" && fileWatcherCallbacks.contains(filePath)) {
384+
// Some applications save a working file via rename operations
385+
if ((eventName === "change" || eventName === "rename") && fileWatcherCallbacks.contains(filePath)) {
385386
for (const fileCallback of fileWatcherCallbacks.get(filePath)) {
386387
fileCallback(filePath);
387388
}

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)