From 5829ca82d0a06cc46738b1566bcbcda4d74b2a30 Mon Sep 17 00:00:00 2001 From: Jason Ramsay Date: Fri, 9 Dec 2016 14:44:08 -0800 Subject: [PATCH] use localUse local updatedFileNames - this way we'll know that set of names is definitely cleared --- src/server/project.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/server/project.ts b/src/server/project.ts index 005e26a1bc8..392008a9fd6 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -675,10 +675,12 @@ namespace ts.server { isInferred: this.projectKind === ProjectKind.Inferred, options: this.getCompilerOptions() }; + const updatedFileNames = this.updatedFileNames; + this.updatedFileNames = undefined; // check if requested version is the same that we have reported last time if (this.lastReportedFileNames && lastKnownVersion === this.lastReportedVersion) { - // if current structure version is the same - return info witout any changes - if (this.projectStructureVersion == this.lastReportedVersion && !this.updatedFileNames) { + // if current structure version is the same - return info without any changes + if (this.projectStructureVersion == this.lastReportedVersion && !updatedFileNames) { return { info, projectErrors: this.projectErrors }; } // compute and return the difference @@ -687,7 +689,7 @@ namespace ts.server { const added: string[] = []; const removed: string[] = []; - const updated: string[] = getOwnKeys(this.updatedFileNames); + const updated: string[] = getOwnKeys(updatedFileNames); for (const id in currentFiles) { if (!hasProperty(lastReportedFileNames, id)) { added.push(id); @@ -700,7 +702,6 @@ namespace ts.server { } this.lastReportedFileNames = currentFiles; this.lastReportedVersion = this.projectStructureVersion; - this.updatedFileNames = undefined; return { info, changes: { added, removed, updated }, projectErrors: this.projectErrors }; } else {