提交 d250ccb1 编写于 作者: I isidor

Revert "actionBar: always dispose action items for now. Debug always recreate...

Revert "actionBar: always dispose action items for now. Debug always recreate focusProcessActionItem"

This reverts commit 742c2998.
上级 742c2998
......@@ -554,7 +554,8 @@ export class ActionBar extends EventEmitter implements IActionRunner {
}
public clear(): void {
this.items = lifecycle.dispose(this.items);
// Do not dispose action items if they were provided from outside
this.items = this.options.actionItemProvider ? [] : lifecycle.dispose(this.items);
$(this.actionsList).empty();
}
......@@ -669,7 +670,7 @@ export class ActionBar extends EventEmitter implements IActionRunner {
public dispose(): void {
if (this.items !== null) {
this.clear();
lifecycle.dispose(this.items);
}
this.items = null;
......
......@@ -52,6 +52,7 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi
private isVisible: boolean;
private isBuilt: boolean;
private focusProcessActionItem: FocusProcessActionItem;
constructor(
@IMessageService private messageService: IMessageService,
......@@ -78,7 +79,12 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi
orientation: ActionsOrientation.HORIZONTAL,
actionItemProvider: (action: IAction) => {
if (action.id === FocusProcessAction.ID) {
return this.instantiationService.createInstance(FocusProcessActionItem, action);
if (!this.focusProcessActionItem) {
this.focusProcessActionItem = this.instantiationService.createInstance(FocusProcessActionItem, action);
this.toDispose.push(this.focusProcessActionItem);
}
return this.focusProcessActionItem;
}
return null;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册