Fixed watcher for rename operations, and for allowJs in config file

(cherry picked from commit 745f32bbee)
This commit is contained in:
Bill Ticehurst 2016-02-11 18:47:56 -08:00
parent bf234887b0
commit cc76f0f7f0
2 changed files with 3 additions and 2 deletions

View file

@ -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);
}

View file

@ -486,7 +486,7 @@ namespace ts {
}
function watchedDirectoryChanged(fileName: string) {
if (fileName && !ts.isSupportedSourceFileName(fileName, commandLine.options)) {
if (fileName && !ts.isSupportedSourceFileName(fileName, compilerOptions)) {
return;
}