Skip to content

Commit

Permalink
feat: add error tolerance for plugin formatting
Browse files Browse the repository at this point in the history
close #1033
  • Loading branch information
johnsoncodehk committed Mar 13, 2022
1 parent 8cb50cc commit 133ccc5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/vue-language-service/src/documentFeatures/format.ts
Expand Up @@ -134,7 +134,14 @@ export function register(context: DocumentServiceRuntimeContext) {
if (!plugin.format)
continue;

const edits = await plugin.format(document, undefined, options);
let edits: vscode.TextEdit[] | null | undefined;

try {
edits = await plugin.format(document, undefined, options);
}
catch (err) {
console.error(err);
}

if (!edits)
continue;
Expand Down

0 comments on commit 133ccc5

Please sign in to comment.