提交 4fc2aacf 编写于 作者: I isidor

fixes #107860

上级 2ec1f83f
......@@ -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,
......@@ -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();
......
......@@ -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) {
......
......@@ -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);
......
......@@ -459,7 +459,8 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget {
getActionViewItem(action: IAction): IActionViewItem | undefined {
if (action.id === SelectReplAction.ID) {
return this.instantiationService.createInstance(SelectReplActionViewItem, this.selectReplAction);
const session = (this.tree ? this.tree.getInput() : undefined) ?? this.debugService.getViewModel().focusedSession;
return this.instantiationService.createInstance(SelectReplActionViewItem, this.selectReplAction, session);
} else if (action.id === FILTER_ACTION_ID) {
this.filterActionViewItem = this.instantiationService.createInstance(ReplFilterActionViewItem, action, localize({ key: 'workbench.debug.filter.placeholder', comment: ['Text in the brackets after e.g. is not localizable'] }, "Filter (e.g. text, !exclude)"), this.filterState);
return this.filterActionViewItem;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册