dispose actions after selection/application of code action (#203936)

dispose actions after selection and application of code action
This commit is contained in:
Justin Chen
2024-02-01 09:14:18 -08:00
committed by GitHub
parent b8ac113876
commit 4e67ba102b
@@ -112,7 +112,12 @@ export class CodeActionController extends Disposable implements IEditorContribut
command.arguments[0] = { ...command.arguments[0], autoSend: false };
}
}
await this._applyCodeAction(actionItem, false, false, ApplyCodeActionReason.FromAILightbulb);
try {
this._lightBulbWidget.value?.hide();
await this._applyCodeAction(actionItem, false, false, ApplyCodeActionReason.FromAILightbulb);
} finally {
actions.dispose();
}
return;
}
await this.showCodeActionList(actions, at, { includeDisabledActions: false, fromLightbulb: true });
@@ -279,7 +284,11 @@ export class CodeActionController extends Disposable implements IEditorContribut
const delegate: IActionListDelegate<CodeActionItem> = {
onSelect: async (action: CodeActionItem, preview?: boolean) => {
this._applyCodeAction(action, /* retrigger */ true, !!preview, ApplyCodeActionReason.FromCodeActions);
try {
await this._applyCodeAction(action, /* retrigger */ true, !!preview, ApplyCodeActionReason.FromCodeActions);
} finally {
actions.dispose();
}
this._actionWidgetService.hide();
currentDecorations.clear();
},