Skip to content

Commit 324f237

Browse files
View menu access for debug consoles (microsoft#152406)
* View menu access for debug consoles Fixes microsoft#152400 * ensure that decug console becomes visible upon view menu selection * Update src/vs/workbench/contrib/quickaccess/browser/viewQuickAccess.ts Co-authored-by: Rob Lourens <[email protected]> * remove index from pick item name Co-authored-by: Rob Lourens <[email protected]>
1 parent 756791f commit 324f237

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/vs/workbench/contrib/quickaccess/browser/viewQuickAccess.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { KeyMod, KeyCode } from 'vs/base/common/keyCodes';
2121
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
2222
import { CATEGORIES } from 'vs/workbench/common/actions';
2323
import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite';
24+
import { IDebugService, REPL_VIEW_ID } from 'vs/workbench/contrib/debug/common/debug';
2425

2526
interface IViewQuickPickItem extends IPickerQuickAccessItem {
2627
containerLabel: string;
@@ -36,6 +37,7 @@ export class ViewQuickAccessProvider extends PickerQuickAccessProvider<IViewQuic
3637
@IOutputService private readonly outputService: IOutputService,
3738
@ITerminalService private readonly terminalService: ITerminalService,
3839
@ITerminalGroupService private readonly terminalGroupService: ITerminalGroupService,
40+
@IDebugService private readonly debugService: IDebugService,
3941
@IPaneCompositePartService private readonly paneCompositeService: IPaneCompositePartService,
4042
@IContextKeyService private readonly contextKeyService: IContextKeyService
4143
) {
@@ -181,6 +183,23 @@ export class ViewQuickAccessProvider extends PickerQuickAccessProvider<IViewQuic
181183
});
182184
});
183185

186+
// Debug Consoles
187+
this.debugService.getModel().getSessions(true).filter(s => s.hasSeparateRepl()).forEach((session, _) => {
188+
const label = session.name;
189+
viewEntries.push({
190+
label,
191+
containerLabel: localize('debugConsoles', "Debug Console"),
192+
accept: async () => {
193+
await this.debugService.focusStackFrame(undefined, undefined, session, { explicit: true });
194+
195+
if (!this.viewsService.isViewVisible(REPL_VIEW_ID)) {
196+
await this.viewsService.openView(REPL_VIEW_ID, true);
197+
}
198+
}
199+
});
200+
201+
});
202+
184203
// Output Channels
185204
const channels = this.outputService.getChannelDescriptors();
186205
for (const channel of channels) {

0 commit comments

Comments
 (0)