diff --git a/src/compiler/sys.ts b/src/compiler/sys.ts index bf25d39aa4..34de18aeaa 100644 --- a/src/compiler/sys.ts +++ b/src/compiler/sys.ts @@ -381,7 +381,8 @@ namespace ts { const filePath = typeof relativeFileName !== "string" ? undefined : toPath(relativeFileName, baseDirPath, createGetCanonicalFileName(sys.useCaseSensitiveFileNames)); - if (eventName === "change" && fileWatcherCallbacks.contains(filePath)) { + // Some applications save a working file via rename operations + if ((eventName === "change" || eventName === "rename") && fileWatcherCallbacks.contains(filePath)) { for (const fileCallback of fileWatcherCallbacks.get(filePath)) { fileCallback(filePath); } diff --git a/src/compiler/tsc.ts b/src/compiler/tsc.ts index 998866c796..cb7484fb95 100644 --- a/src/compiler/tsc.ts +++ b/src/compiler/tsc.ts @@ -486,7 +486,7 @@ namespace ts { } function watchedDirectoryChanged(fileName: string) { - if (fileName && !ts.isSupportedSourceFileName(fileName, commandLine.options)) { + if (fileName && !ts.isSupportedSourceFileName(fileName, compilerOptions)) { return; }