From c64a4f0b024144a94eef12595a25b19af6308829 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Tue, 6 Oct 2020 14:53:40 -0700 Subject: [PATCH] Revert "fixes #107860" This reverts commit b8e87aae6dca78fe0f8dbffd9d6a34921d9913f4. --- .../contrib/debug/browser/debugActionViewItems.ts | 9 +++------ src/vs/workbench/contrib/debug/browser/debugToolBar.ts | 2 +- src/vs/workbench/contrib/debug/browser/debugViewlet.ts | 2 +- src/vs/workbench/contrib/debug/browser/repl.ts | 2 +- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/vs/workbench/contrib/debug/browser/debugActionViewItems.ts b/src/vs/workbench/contrib/debug/browser/debugActionViewItems.ts index 97d2519b2970e..ec89f5b46193f 100644 --- a/src/vs/workbench/contrib/debug/browser/debugActionViewItems.ts +++ b/src/vs/workbench/contrib/debug/browser/debugActionViewItems.ts @@ -234,7 +234,6 @@ export class StartDebugActionViewItem implements IActionViewItem { export class FocusSessionActionViewItem extends SelectActionViewItem { constructor( action: IAction, - session: IDebugSession | undefined, @IDebugService protected readonly debugService: IDebugService, @IThemeService themeService: IThemeService, @IContextViewService contextViewService: IContextViewService, @@ -263,17 +262,15 @@ export class FocusSessionActionViewItem extends SelectActionViewItem { }); this._register(this.debugService.onDidEndSession(() => this.update())); - this.update(session); + this.update(); } protected getActionContext(_: string, index: number): any { return this.getSessions()[index]; } - private update(session?: IDebugSession) { - if (!session) { - session = this.getSelectedSession(); - } + private update() { + const session = this.getSelectedSession(); const sessions = this.getSessions(); const names = sessions.map(s => { const label = s.getLabel(); diff --git a/src/vs/workbench/contrib/debug/browser/debugToolBar.ts b/src/vs/workbench/contrib/debug/browser/debugToolBar.ts index 93635f7ff1ae0..5dcee2af03364 100644 --- a/src/vs/workbench/contrib/debug/browser/debugToolBar.ts +++ b/src/vs/workbench/contrib/debug/browser/debugToolBar.ts @@ -75,7 +75,7 @@ export class DebugToolBar extends Themable implements IWorkbenchContribution { orientation: ActionsOrientation.HORIZONTAL, actionViewItemProvider: (action: IAction) => { if (action.id === FocusSessionAction.ID) { - return this.instantiationService.createInstance(FocusSessionActionViewItem, action, undefined); + return this.instantiationService.createInstance(FocusSessionActionViewItem, action); } else if (action instanceof MenuItemAction) { return this.instantiationService.createInstance(MenuEntryActionViewItem, action); } else if (action instanceof SubmenuItemAction) { diff --git a/src/vs/workbench/contrib/debug/browser/debugViewlet.ts b/src/vs/workbench/contrib/debug/browser/debugViewlet.ts index f13479c4ec5b2..1d805139611c0 100644 --- a/src/vs/workbench/contrib/debug/browser/debugViewlet.ts +++ b/src/vs/workbench/contrib/debug/browser/debugViewlet.ts @@ -171,7 +171,7 @@ export class DebugViewPaneContainer extends ViewPaneContainer { return this.startDebugActionViewItem; } if (action.id === FocusSessionAction.ID) { - return new FocusSessionActionViewItem(action, undefined, this.debugService, this.themeService, this.contextViewService, this.configurationService); + return new FocusSessionActionViewItem(action, this.debugService, this.themeService, this.contextViewService, this.configurationService); } if (action instanceof MenuItemAction) { return this.instantiationService.createInstance(MenuEntryActionViewItem, action); diff --git a/src/vs/workbench/contrib/debug/browser/repl.ts b/src/vs/workbench/contrib/debug/browser/repl.ts index b25915d28d5bc..7fe44b35aaf80 100644 --- a/src/vs/workbench/contrib/debug/browser/repl.ts +++ b/src/vs/workbench/contrib/debug/browser/repl.ts @@ -459,7 +459,7 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget { getActionViewItem(action: IAction): IActionViewItem | undefined { if (action.id === SelectReplAction.ID) { - return this.instantiationService.createInstance(SelectReplActionViewItem, this.selectReplAction, this.tree.getInput()); + return this.instantiationService.createInstance(SelectReplActionViewItem, this.selectReplAction); } else if (action.id === FILTER_ACTION_ID) { this.filterActionViewItem = this.instantiationService.createInstance(ReplFilterActionViewItem, action, localize('workbench.debug.filter.placeholder', "Filter (e.g. text, !exclude)"), this.filterState); return this.filterActionViewItem;