From 08ab6eb42dddee1f501998445046653de5aa4eab Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 23 Feb 2018 12:10:24 -0800 Subject: [PATCH] Reload the text from file if there is pending reload of the script info before determining to use SVC Fixes #20806 --- src/server/scriptInfo.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/server/scriptInfo.ts b/src/server/scriptInfo.ts index 6fc4f241f65..d368acd5ce3 100644 --- a/src/server/scriptInfo.ts +++ b/src/server/scriptInfo.ts @@ -176,8 +176,13 @@ namespace ts.server { return this.switchToScriptVersionCache(); } - // Else if the svc is uptodate with the text, we are good - return !this.pendingReloadFromDisk && this.svc; + // If there is pending reload from the disk then, reload the text + if (this.pendingReloadFromDisk) { + this.reloadWithFileText(); + } + + // At this point if svc is present its valid + return this.svc; } private getOrLoadText() {