From c1ffc0ec43d1f9058cfff752c641bed41a94524b Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Fri, 8 Nov 2019 16:51:23 -0800 Subject: [PATCH] Don't dispose of code actions before they are applied --- src/vs/editor/contrib/codeAction/codeActionUi.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/editor/contrib/codeAction/codeActionUi.ts b/src/vs/editor/contrib/codeAction/codeActionUi.ts index 7e80fdaff8c..8db5d28fa24 100644 --- a/src/vs/editor/contrib/codeAction/codeActionUi.ts +++ b/src/vs/editor/contrib/codeAction/codeActionUi.ts @@ -30,7 +30,7 @@ export class CodeActionUi extends Disposable { quickFixActionId: string, preferredFixActionId: string, private readonly delegate: { - applyCodeAction: (action: CodeAction, regtriggerAfterApply: boolean) => void + applyCodeAction: (action: CodeAction, regtriggerAfterApply: boolean) => Promise }, @IContextMenuService contextMenuService: IContextMenuService, @IKeybindingService keybindingService: IKeybindingService, @@ -81,7 +81,7 @@ export class CodeActionUi extends Disposable { // Apply if we only have one action or requested autoApply if (newState.trigger.autoApply === CodeActionAutoApply.First || (newState.trigger.autoApply === CodeActionAutoApply.IfSingle && actions.actions.length === 1)) { try { - this.delegate.applyCodeAction(actions.actions[0], false); + await this.delegate.applyCodeAction(actions.actions[0], false); } finally { actions.dispose(); } -- GitLab