mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 20:52: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,14 +313,18 @@ export class TypeScriptWorker implements ts.LanguageServiceHost, ITypeScriptWork
|
||||||
formatOptions: ts.FormatCodeOptions
|
formatOptions: ts.FormatCodeOptions
|
||||||
): Promise<ReadonlyArray<ts.CodeFixAction>> {
|
): Promise<ReadonlyArray<ts.CodeFixAction>> {
|
||||||
const preferences = {};
|
const preferences = {};
|
||||||
return this._languageService.getCodeFixesAtPosition(
|
try {
|
||||||
fileName,
|
return this._languageService.getCodeFixesAtPosition(
|
||||||
start,
|
fileName,
|
||||||
end,
|
start,
|
||||||
errorCodes,
|
end,
|
||||||
formatOptions,
|
errorCodes,
|
||||||
preferences
|
formatOptions,
|
||||||
);
|
preferences
|
||||||
|
);
|
||||||
|
} catch {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async updateExtraLibs(extraLibs: IExtraLibs): Promise<void> {
|
async updateExtraLibs(extraLibs: IExtraLibs): Promise<void> {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue