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() {