From ae4f164eb284c7cc51bfe7422dd624f0882b7868 Mon Sep 17 00:00:00 2001 From: steveluc Date: Fri, 20 Mar 2015 22:14:39 -0700 Subject: [PATCH] Added gc of configured projects to handle case in which file is opened in directory configured by tsconfig.json, but file not part of the configured project. --- src/server/editorServices.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index bcb9fb24f3f..e78e6fa8b78 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -508,6 +508,16 @@ module ts.server { this.printProjects(); } + gcConfiguredProjects() { + var configuredProjects: Project[] = []; + for (var i = 0, len = this.configuredProjects.length; i < len; i++) { + if (this.configuredProjects[i].openRefCount > 0) { + configuredProjects.push(this.configuredProjects[i]); + } + } + this.configuredProjects = configuredProjects; + } + setConfiguredProjectRoot(info: ScriptInfo) { for (var i = 0, len = this.configuredProjects.length; i < len; i++) { let configuredProject = this.configuredProjects[i]; @@ -555,6 +565,7 @@ module ts.server { this.openFileRoots.push(info); } } + this.gcConfiguredProjects(); } /**