提交 c1ffc0ec 编写于 作者: M Matt Bierner

Don't dispose of code actions before they are applied

上级 696465bd
...@@ -30,7 +30,7 @@ export class CodeActionUi extends Disposable { ...@@ -30,7 +30,7 @@ export class CodeActionUi extends Disposable {
quickFixActionId: string, quickFixActionId: string,
preferredFixActionId: string, preferredFixActionId: string,
private readonly delegate: { private readonly delegate: {
applyCodeAction: (action: CodeAction, regtriggerAfterApply: boolean) => void applyCodeAction: (action: CodeAction, regtriggerAfterApply: boolean) => Promise<void>
}, },
@IContextMenuService contextMenuService: IContextMenuService, @IContextMenuService contextMenuService: IContextMenuService,
@IKeybindingService keybindingService: IKeybindingService, @IKeybindingService keybindingService: IKeybindingService,
...@@ -81,7 +81,7 @@ export class CodeActionUi extends Disposable { ...@@ -81,7 +81,7 @@ export class CodeActionUi extends Disposable {
// Apply if we only have one action or requested autoApply // 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)) { if (newState.trigger.autoApply === CodeActionAutoApply.First || (newState.trigger.autoApply === CodeActionAutoApply.IfSingle && actions.actions.length === 1)) {
try { try {
this.delegate.applyCodeAction(actions.actions[0], false); await this.delegate.applyCodeAction(actions.actions[0], false);
} finally { } finally {
actions.dispose(); actions.dispose();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册