mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-29 16:29:19 -05:00
Cleanup script infos that are not part of any project when the project is closed or inferred projects are refreshed
Also dispose some pointers so that the closures get disposed with project and script infos
This commit is contained in:
@@ -116,7 +116,7 @@ namespace ts.server {
|
||||
|
||||
public languageServiceEnabled = true;
|
||||
|
||||
protected readonly lsHost: LSHost;
|
||||
protected lsHost: LSHost;
|
||||
|
||||
builder: Builder;
|
||||
/**
|
||||
@@ -297,9 +297,15 @@ namespace ts.server {
|
||||
this.rootFiles = undefined;
|
||||
this.rootFilesMap = undefined;
|
||||
this.program = undefined;
|
||||
this.builder = undefined;
|
||||
this.cachedUnresolvedImportsPerFile = undefined;
|
||||
this.projectErrors = undefined;
|
||||
this.lsHost.dispose();
|
||||
this.lsHost = undefined;
|
||||
|
||||
// signal language service to release source files acquired from document registry
|
||||
this.languageService.dispose();
|
||||
this.languageService = undefined;
|
||||
}
|
||||
|
||||
getCompilerOptions() {
|
||||
@@ -1043,6 +1049,7 @@ namespace ts.server {
|
||||
|
||||
if (this.projectFileWatcher) {
|
||||
this.projectFileWatcher.close();
|
||||
this.projectFileWatcher = undefined;
|
||||
}
|
||||
|
||||
if (this.typeRootsWatchers) {
|
||||
@@ -1132,4 +1139,4 @@ namespace ts.server {
|
||||
this.typeAcquisition = newTypeAcquisition;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user