mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-07-07 18:25:51 -05:00
Structure is reused should be on new program instead of old program (#41005)
This commit is contained in:
@@ -1086,7 +1086,7 @@ namespace ts.server {
|
||||
// bump up the version if
|
||||
// - oldProgram is not set - this is a first time updateGraph is called
|
||||
// - newProgram is different from the old program and structure of the old program was not reused.
|
||||
const hasNewProgram = this.program && (!oldProgram || (this.program !== oldProgram && !(oldProgram.structureIsReused! & StructureIsReused.Completely)));
|
||||
const hasNewProgram = this.program && (!oldProgram || (this.program !== oldProgram && !(this.program.structureIsReused & StructureIsReused.Completely)));
|
||||
if (hasNewProgram) {
|
||||
if (oldProgram) {
|
||||
for (const f of oldProgram.getSourceFiles()) {
|
||||
@@ -1153,7 +1153,7 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
if (!this.importSuggestionsCache.isEmpty()) {
|
||||
if (this.hasAddedorRemovedFiles || oldProgram && !oldProgram.structureIsReused) {
|
||||
if (this.hasAddedorRemovedFiles || oldProgram && !this.program.structureIsReused) {
|
||||
this.importSuggestionsCache.clear();
|
||||
}
|
||||
else if (this.dirtyFilesForSuggestions && oldProgram && this.program) {
|
||||
@@ -1194,7 +1194,7 @@ namespace ts.server {
|
||||
this.print(/*writeProjectFileNames*/ true);
|
||||
}
|
||||
else if (this.program !== oldProgram) {
|
||||
this.writeLog(`Different program with same set of files:: oldProgram.structureIsReused:: ${oldProgram && oldProgram.structureIsReused}`);
|
||||
this.writeLog(`Different program with same set of files:: structureIsReused:: ${this.program.structureIsReused}`);
|
||||
}
|
||||
return hasNewProgram;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user