mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 21:06:50 -05:00
Do not remove inferred project immediately and try to reuse it on next file open
This commit is contained in:
@@ -591,6 +591,11 @@ namespace ts.server {
|
||||
return this.rootFiles && this.rootFiles.length > 0;
|
||||
}
|
||||
|
||||
/*@internal*/
|
||||
isOrphan() {
|
||||
return false;
|
||||
}
|
||||
|
||||
getRootFiles() {
|
||||
return this.rootFiles && this.rootFiles.map(info => info.fileName);
|
||||
}
|
||||
@@ -1173,6 +1178,10 @@ namespace ts.server {
|
||||
/** this is canonical project root path */
|
||||
readonly projectRootPath: string | undefined;
|
||||
|
||||
/*@internal*/
|
||||
/** stored only if their is no projectRootPath and this isnt single inferred project */
|
||||
readonly canonicalCurrentDirectory: string | undefined;
|
||||
|
||||
/*@internal*/
|
||||
constructor(
|
||||
projectService: ProjectService,
|
||||
@@ -1191,6 +1200,9 @@ namespace ts.server {
|
||||
projectService.host,
|
||||
currentDirectory);
|
||||
this.projectRootPath = projectRootPath && projectService.toCanonicalFileName(projectRootPath);
|
||||
if (!projectRootPath && !projectService.useSingleInferredProject) {
|
||||
this.canonicalCurrentDirectory = projectService.toCanonicalFileName(this.currentDirectory);
|
||||
}
|
||||
this.enableGlobalPlugins();
|
||||
}
|
||||
|
||||
@@ -1213,6 +1225,11 @@ namespace ts.server {
|
||||
}
|
||||
}
|
||||
|
||||
/*@internal*/
|
||||
isOrphan() {
|
||||
return !this.hasRoots();
|
||||
}
|
||||
|
||||
isProjectWithSingleRoot() {
|
||||
// - when useSingleInferredProject is not set and projectRootPath is not set,
|
||||
// we can guarantee that this will be the only root
|
||||
|
||||
Reference in New Issue
Block a user