Skip to content

Commit 7ecf90e

Browse files
author
zhengbli
committed
Fix issue: can't add a file back to a configured project after being deleted once
1 parent 28c2887 commit 7ecf90e

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/server/editorServices.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,11 +1267,15 @@ namespace ts.server {
12671267
if (info.isOpen) {
12681268
if (this.openFileRoots.indexOf(info) >= 0) {
12691269
this.openFileRoots = copyListRemovingItem(info, this.openFileRoots);
1270+
if (info.defaultProject && !info.defaultProject.isConfiguredProject()) {
1271+
this.removeProject(info.defaultProject);
1272+
}
12701273
}
12711274
if (this.openFilesReferenced.indexOf(info) >= 0) {
12721275
this.openFilesReferenced = copyListRemovingItem(info, this.openFilesReferenced);
12731276
}
12741277
this.openFileRootsConfigured.push(info);
1278+
info.defaultProject = project;
12751279
}
12761280
}
12771281
project.addRoot(info);

0 commit comments

Comments
 (0)