diff --git a/src/vs/workbench/contrib/debug/browser/debugActionViewItems.ts b/src/vs/workbench/contrib/debug/browser/debugActionViewItems.ts index 97d2519b2970ec65a34fc181e827be50fee5bc9f..ec89f5b46193ff0a28a3dfb6d86a2a5c86515cee 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 93635f7ff1ae026b5c3325281e912dd610b7ebf3..5dcee2af03364d6fbdbd9f2fcb4c4b77f5b8f889 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 f13479c4ec5b2113e8739780bb996cad52006489..1d805139611c00b2a65db4890f39344d1dfd30da 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 b25915d28d5bc69d3cca5081d1326ab56ee6d885..7fe44b35aaf80261d8de43b2eea46ff48d128ec5 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;