Code action on save failures should not block other actions from running

Fixes #65733
pull/65426/head^2
Matt Bierner 2019-01-02 14:03:49 -08:00
parent 0841e1d78b
commit c809337d5c
1 changed files with 4 additions and 1 deletions

View File

@ -321,7 +321,10 @@ class CodeActionOnParticipant implements ISaveParticipant {
return new Promise<CodeAction[]>((resolve, reject) => {
setTimeout(() => reject(localize('codeActionsOnSave.didTimeout', "Aborted codeActionsOnSave after {0}ms", timeout)), timeout);
this.getActionsToRun(model, codeActionsOnSave).then(resolve);
}).then(actionsToRun => this.applyCodeActions(actionsToRun));
}).then(actionsToRun => {
// Failure to apply a code action should not block other on save actions
return this.applyCodeActions(actionsToRun).catch(() => undefined);
});
}
private async applyCodeActions(actionsToRun: CodeAction[]) {