mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-04-12 23:36:28 -05:00
Ensure the updates with crashes reverts the change to scriptInfo (#58846)
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user