mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 18:32:56 +01:00
Fixes microsoft/monaco-editor#1638: Protect against failing getCodeFixesAtPosition calls
This commit is contained in:
parent
8381cb3579
commit
0ac03ae5cd
1 changed files with 12 additions and 8 deletions
|
|
@ -313,6 +313,7 @@ export class TypeScriptWorker implements ts.LanguageServiceHost, ITypeScriptWork
|
|||
formatOptions: ts.FormatCodeOptions
|
||||
): Promise<ReadonlyArray<ts.CodeFixAction>> {
|
||||
const preferences = {};
|
||||
try {
|
||||
return this._languageService.getCodeFixesAtPosition(
|
||||
fileName,
|
||||
start,
|
||||
|
|
@ -321,6 +322,9 @@ export class TypeScriptWorker implements ts.LanguageServiceHost, ITypeScriptWork
|
|||
formatOptions,
|
||||
preferences
|
||||
);
|
||||
} catch {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
async updateExtraLibs(extraLibs: IExtraLibs): Promise<void> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue