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

Make sure dispose of code actions on hover properly

Fixes #75445
上级 a767e5e8
......@@ -566,10 +566,8 @@ export class ModesContentHoverWidget extends ContentHoverWidget {
return createCancelablePromise(async cancellationToken => {
const codeActions = await getCodeActions(this._editor.getModel()!, new Range(marker.startLineNumber, marker.startColumn, marker.endLineNumber, marker.endColumn), { type: 'manual', filter: { kind: CodeActionKind.QuickFix } }, cancellationToken);
if (codeActions.actions.length) {
const disposables = new DisposableStore();
const actions: Action[] = [];
for (const codeAction of codeActions.actions) {
disposables.add(disposables);
actions.push(new Action(
codeAction.command ? codeAction.command.id : codeAction.title,
codeAction.title,
......@@ -579,7 +577,7 @@ export class ModesContentHoverWidget extends ContentHoverWidget {
}
return {
actions: actions,
dispose: () => disposables.dispose()
dispose: () => codeActions.dispose()
};
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册