Skip to content

Commit 5829ca8

Browse files
committed
use localUse local updatedFileNames - this way we'll know that set of names is definitely cleared
1 parent 30bd841 commit 5829ca8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/server/project.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -675,10 +675,12 @@ namespace ts.server {
675675
isInferred: this.projectKind === ProjectKind.Inferred,
676676
options: this.getCompilerOptions()
677677
};
678+
const updatedFileNames = this.updatedFileNames;
679+
this.updatedFileNames = undefined;
678680
// check if requested version is the same that we have reported last time
679681
if (this.lastReportedFileNames && lastKnownVersion === this.lastReportedVersion) {
680-
// if current structure version is the same - return info witout any changes
681-
if (this.projectStructureVersion == this.lastReportedVersion && !this.updatedFileNames) {
682+
// if current structure version is the same - return info without any changes
683+
if (this.projectStructureVersion == this.lastReportedVersion && !updatedFileNames) {
682684
return { info, projectErrors: this.projectErrors };
683685
}
684686
// compute and return the difference
@@ -687,7 +689,7 @@ namespace ts.server {
687689

688690
const added: string[] = [];
689691
const removed: string[] = [];
690-
const updated: string[] = getOwnKeys(this.updatedFileNames);
692+
const updated: string[] = getOwnKeys(updatedFileNames);
691693
for (const id in currentFiles) {
692694
if (!hasProperty(lastReportedFileNames, id)) {
693695
added.push(id);
@@ -700,7 +702,6 @@ namespace ts.server {
700702
}
701703
this.lastReportedFileNames = currentFiles;
702704
this.lastReportedVersion = this.projectStructureVersion;
703-
this.updatedFileNames = undefined;
704705
return { info, changes: { added, removed, updated }, projectErrors: this.projectErrors };
705706
}
706707
else {

0 commit comments

Comments
 (0)