From 745f32bbee791cfef0862fe95a18aa66274d095a 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 --- 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 bf25d39aa4395..34de18aeaa3c2 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 998866c796cbe..cb7484fb95c40 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; }