Fix issue: can't add a file back to a configured project after being deleted once

This commit is contained in:
zhengbli
2015-10-19 22:56:00 -07:00
parent 28c2887d50
commit 7ecf90ee2d

View File

@@ -1267,11 +1267,15 @@ namespace ts.server {
if (info.isOpen) {
if (this.openFileRoots.indexOf(info) >= 0) {
this.openFileRoots = copyListRemovingItem(info, this.openFileRoots);
if (info.defaultProject && !info.defaultProject.isConfiguredProject()) {
this.removeProject(info.defaultProject);
}
}
if (this.openFilesReferenced.indexOf(info) >= 0) {
this.openFilesReferenced = copyListRemovingItem(info, this.openFilesReferenced);
}
this.openFileRootsConfigured.push(info);
info.defaultProject = project;
}
}
project.addRoot(info);