Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
isidorn authored and Your Name committed Oct 2, 2020
1 parent 456b12b commit b6546b3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ 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,
Expand Down Expand Up @@ -262,15 +263,17 @@ export class FocusSessionActionViewItem extends SelectActionViewItem {
});
this._register(this.debugService.onDidEndSession(() => this.update()));

this.update();
this.update(session);
}

protected getActionContext(_: string, index: number): any {
return this.getSessions()[index];
}

private update() {
const session = this.getSelectedSession();
private update(session?: IDebugSession) {
if (!session) {
session = this.getSelectedSession();
}
const sessions = this.getSessions();
const names = sessions.map(s => {
const label = s.getLabel();
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/contrib/debug/browser/debugToolBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
return this.instantiationService.createInstance(FocusSessionActionViewItem, action, undefined);
} else if (action instanceof MenuItemAction) {
return this.instantiationService.createInstance(MenuEntryActionViewItem, action);
} else if (action instanceof SubmenuItemAction) {
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/contrib/debug/browser/debugViewlet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export class DebugViewPaneContainer extends ViewPaneContainer {
return this.startDebugActionViewItem;
}
if (action.id === FocusSessionAction.ID) {
return new FocusSessionActionViewItem(action, this.debugService, this.themeService, this.contextViewService, this.configurationService);
return new FocusSessionActionViewItem(action, undefined, this.debugService, this.themeService, this.contextViewService, this.configurationService);
}
if (action instanceof MenuItemAction) {
return this.instantiationService.createInstance(MenuEntryActionViewItem, action);
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/contrib/debug/browser/repl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
return this.instantiationService.createInstance(SelectReplActionViewItem, this.selectReplAction, this.tree.getInput());
} 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;
Expand Down

0 comments on commit b6546b3

Please sign in to comment.