Skip to content

Commit 08ab6eb

Browse files
committed
Reload the text from file if there is pending reload of the script info before determining to use SVC
Fixes #20806
1 parent 4d6b53b commit 08ab6eb

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/server/scriptInfo.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,13 @@ namespace ts.server {
176176
return this.switchToScriptVersionCache();
177177
}
178178

179-
// Else if the svc is uptodate with the text, we are good
180-
return !this.pendingReloadFromDisk && this.svc;
179+
// If there is pending reload from the disk then, reload the text
180+
if (this.pendingReloadFromDisk) {
181+
this.reloadWithFileText();
182+
}
183+
184+
// At this point if svc is present its valid
185+
return this.svc;
181186
}
182187

183188
private getOrLoadText() {

0 commit comments

Comments
 (0)