mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 17:19:48 +01:00
dispose actions after selection/application of code action (#203936)
dispose actions after selection and application of code action
This commit is contained in:
@@ -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();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user