Skip to content

Commit 428bc68

Browse files
committed
Add comment for deletion of orphan script infos in file open
1 parent 98cb0ce commit 428bc68

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/server/editorServices.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1484,6 +1484,10 @@ namespace ts.server {
14841484
// at this point if file is the part of some configured/external project then this project should be created
14851485
const info = this.getOrCreateScriptInfoForNormalizedPath(fileName, /*openedByClient*/ true, fileContent, scriptKind, hasMixedContent);
14861486
this.assignScriptInfoToInferredProjectIfNecessary(info, /*addToListOfOpenFiles*/ true);
1487+
// Delete the orphan files here because there might be orphan script infos (which are not part of project)
1488+
// when some file/s were closed which resulted in project removal.
1489+
// It was then postponed to cleanup these script infos so that they can be reused if
1490+
// the file from that old project is reopened because of opening file from here.
14871491
this.deleteOrphanScriptInfoNotInAnyProject();
14881492
this.printProjects();
14891493
return { configFileName, configFileErrors };

0 commit comments

Comments
 (0)