提交 d5cc4a06 编写于 作者: I isidor

debug: make sure to dispose contributed context menu

#62829
上级 088b323f
......@@ -200,6 +200,7 @@ export class BaseDebugController extends WorkbenchTreeController {
super(options, configurationService);
this.contributedContextMenu = menuService.createMenu(menuId, contextKeyService);
this.disposables.push(this.contributedContextMenu);
}
public onContextMenu(tree: ITree, element: IEnablement, event: ContextMenuEvent, focusElement = true): boolean {
......
......@@ -97,6 +97,7 @@ export class CallStackView extends TreeViewsViewletPanel {
this.treeContainer = renderViewTree(container);
const actionProvider = new CallStackActionProvider(this.debugService, this.keybindingService, this.instantiationService);
const controller = this.instantiationService.createInstance(CallStackController, actionProvider, MenuId.DebugCallStackContext, {});
this.disposables.push(controller);
this.dataSource = new CallStackDataSource();
this.tree = this.instantiationService.createInstance(WorkbenchTree, this.treeContainer, {
dataSource: this.dataSource,
......
......@@ -283,6 +283,7 @@ export class Repl extends Panel implements IPrivateReplService, IHistoryNavigati
this.renderer = this.instantiationService.createInstance(ReplExpressionsRenderer);
const controller = this.instantiationService.createInstance(ReplExpressionsController, new ReplExpressionsActionProvider(this.clearReplAction, this.replInput), MenuId.DebugConsoleContext, { openMode: OpenMode.SINGLE_CLICK, clickBehavior: ClickBehavior.ON_MOUSE_UP /* do not change, to preserve focus behaviour in input field */ });
this.toDispose.push(controller);
controller.toFocusOnClick = this.replInput;
this.tree = this.instantiationService.createInstance(WorkbenchTree, this.treeContainer, {
......
......@@ -79,12 +79,14 @@ export class VariablesView extends TreeViewsViewletPanel {
public renderBody(container: HTMLElement): void {
dom.addClass(container, 'debug-variables');
this.treeContainer = renderViewTree(container);
const controller = this.instantiationService.createInstance(VariablesController, new VariablesActionProvider(this.debugService, this.keybindingService), MenuId.DebugVariablesContext, { openMode: OpenMode.SINGLE_CLICK, clickBehavior: ClickBehavior.ON_MOUSE_UP });
this.disposables.push(controller);
this.tree = this.instantiationService.createInstance(WorkbenchTree, this.treeContainer, {
dataSource: new VariablesDataSource(),
renderer: this.instantiationService.createInstance(VariablesRenderer),
accessibilityProvider: new VariablesAccessibilityProvider(),
controller: this.instantiationService.createInstance(VariablesController, new VariablesActionProvider(this.debugService, this.keybindingService), MenuId.DebugVariablesContext, { openMode: OpenMode.SINGLE_CLICK, clickBehavior: ClickBehavior.ON_MOUSE_UP })
controller
}, {
ariaLabel: nls.localize('variablesAriaTreeLabel', "Debug Variables"),
twistiePixels
......
......@@ -59,11 +59,13 @@ export class WatchExpressionsView extends TreeViewsViewletPanel {
this.treeContainer = renderViewTree(container);
const actionProvider = new WatchExpressionsActionProvider(this.debugService, this.keybindingService);
const controller = this.instantiationService.createInstance(WatchExpressionsController, actionProvider, MenuId.DebugWatchContext, { clickBehavior: ClickBehavior.ON_MOUSE_UP /* do not change to not break DND */, openMode: OpenMode.SINGLE_CLICK });
this.disposables.push(controller);
this.tree = this.instantiationService.createInstance(WorkbenchTree, this.treeContainer, {
dataSource: new WatchExpressionsDataSource(this.debugService),
renderer: this.instantiationService.createInstance(WatchExpressionsRenderer),
accessibilityProvider: new WatchExpressionsAccessibilityProvider(),
controller: this.instantiationService.createInstance(WatchExpressionsController, actionProvider, MenuId.DebugWatchContext, { clickBehavior: ClickBehavior.ON_MOUSE_UP /* do not change to not break DND */, openMode: OpenMode.SINGLE_CLICK }),
controller,
dnd: new WatchExpressionsDragAndDrop(this.debugService)
}, {
ariaLabel: nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'watchAriaTreeLabel' }, "Debug Watch Expressions"),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册