From 428bc68baa3ca6d2027edb588a95a2d4c1bc6ed7 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 14 Jun 2017 15:02:24 -0700 Subject: [PATCH] Add comment for deletion of orphan script infos in file open --- src/server/editorServices.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 5f4561a8b1e..f2536b8dcb4 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -1484,6 +1484,10 @@ namespace ts.server { // at this point if file is the part of some configured/external project then this project should be created const info = this.getOrCreateScriptInfoForNormalizedPath(fileName, /*openedByClient*/ true, fileContent, scriptKind, hasMixedContent); this.assignScriptInfoToInferredProjectIfNecessary(info, /*addToListOfOpenFiles*/ true); + // Delete the orphan files here because there might be orphan script infos (which are not part of project) + // when some file/s were closed which resulted in project removal. + // It was then postponed to cleanup these script infos so that they can be reused if + // the file from that old project is reopened because of opening file from here. this.deleteOrphanScriptInfoNotInAnyProject(); this.printProjects(); return { configFileName, configFileErrors };