Skip to content

Commit 2777c3a

Browse files
committed
Close the file watcher if present for the source file
1 parent 05fcc22 commit 2777c3a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/compiler/watch.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,9 @@ namespace ts {
749749
(missingFilePathsRequestedForRelease || (missingFilePathsRequestedForRelease = [])).push(oldSourceFile.path);
750750
}
751751
else if ((hostSourceFileInfo as FilePresentOnHost).sourceFile === oldSourceFile) {
752+
if ((hostSourceFileInfo as FilePresentOnHost).fileWatcher) {
753+
(hostSourceFileInfo as FilePresentOnHost).fileWatcher.close();
754+
}
752755
sourceFilesCache.delete(oldSourceFile.path);
753756
resolutionCache.removeResolutionsOfFile(oldSourceFile.path);
754757
}

0 commit comments

Comments
 (0)