Close the file watcher if present for the source file

This commit is contained in:
Sheetal Nandi
2018-02-21 11:01:58 -08:00
parent 05fcc225a4
commit 2777c3a890

View File

@@ -749,6 +749,9 @@ namespace ts {
(missingFilePathsRequestedForRelease || (missingFilePathsRequestedForRelease = [])).push(oldSourceFile.path);
}
else if ((hostSourceFileInfo as FilePresentOnHost).sourceFile === oldSourceFile) {
if ((hostSourceFileInfo as FilePresentOnHost).fileWatcher) {
(hostSourceFileInfo as FilePresentOnHost).fileWatcher.close();
}
sourceFilesCache.delete(oldSourceFile.path);
resolutionCache.removeResolutionsOfFile(oldSourceFile.path);
}