diff --git a/src/compiler/sys.ts b/src/compiler/sys.ts index c2d4f449721..4cf94655b35 100644 --- a/src/compiler/sys.ts +++ b/src/compiler/sys.ts @@ -378,7 +378,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 8515d745e6b..e54c49a8c0a 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; }