mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Close watchers for TI that are no longer needed
This commit is contained in:
1 parent
3ae4463ad2
commit
e89404fa2f
14 files changed
+684
-10
No files matched your search
@@ -2023,9 +2023,11 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo
|
||||
else {
|
||||
this.typeAcquisition = undefined;
|
||||
}
|
||||
// If the typeAcquition is disabled, dont use typing files as root
|
||||
// If the typeAcquition is disabled, dont use typing files as root and close existing watchers from TI
|
||||
if (!this.getTypeAcquisition().enable) {
|
||||
const typingsCache = this.typingsCache;
|
||||
this.updateTypingFiles(/*setTypings*/ undefined, /*newTypings*/ undefined, /*scheduleUpdate*/ false);
|
||||
if (typingsCache) this.projectService.typingsInstaller.onProjectClosed(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -487,7 +487,7 @@ export abstract class TypingsInstaller {
|
||||
|
||||
const existing = this.projectWatchers.get(projectName);
|
||||
const newSet = new Set(files);
|
||||
if (!existing || forEachKey(newSet, s => !existing.has(s)) || forEachKey(existing, s => !newSet.has(s))) {
|
||||
if (!existing || newSet.size !== existing.size || forEachKey(newSet, s => !existing.has(s)) || forEachKey(existing, s => !newSet.has(s))) {
|
||||
this.projectWatchers.set(projectName, newSet);
|
||||
this.sendResponse({ kind: ActionWatchTypingLocations, projectName, files });
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user