From cc76f0f7f034abd1469d97db5a02d879a2d5274c Mon Sep 17 00:00:00 2001 From: Bill Ticehurst Date: Thu, 11 Feb 2016 18:47:56 -0800 Subject: [PATCH] Fixed watcher for rename operations, and for allowJs in config file (cherry picked from commit 745f32bbee791cfef0862fe95a18aa66274d095a) --- src/compiler/sys.ts | 3 ++- src/compiler/tsc.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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; }