Skip to content

Commit

Permalink
🤖 Pick PR #58846 (Ensure the updates with crashes rev...) into releas…
Browse files Browse the repository at this point in the history
…e-5.5 (#58847)

Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
  • Loading branch information
TypeScript Bot and sheetalkamat authored Jun 14, 2024
1 parent a20c69e commit 2b0009c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/server/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2245,8 +2245,12 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo

this.getScriptInfo(rootFile)?.editContent(0, originalText.length, updatedText);
this.updateGraph();
cb(this.program!, originalProgram, (this.program?.getSourceFile(rootFile))!);
this.getScriptInfo(rootFile)?.editContent(0, this.program!.getSourceFile(rootFile)!.getText().length, originalText);
try {
cb(this.program!, originalProgram, (this.program?.getSourceFile(rootFile))!);
}
finally {
this.getScriptInfo(rootFile)?.editContent(0, this.program!.getSourceFile(rootFile)!.getText().length, originalText);
}
}

/** @internal */
Expand Down

0 comments on commit 2b0009c

Please sign in to comment.