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;