Merge pull request #7055 from Microsoft/port7042

Fixed watcher for rename operations, and for allowJs in config file
This commit is contained in:
Bill Ticehurst
2016-02-12 10:32:55 -08:00
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;
}