提交 4808112e 编写于 作者: I isidor

debug: toggle repl action

上级 398a40db
......@@ -482,7 +482,7 @@ export class DebugViewlet extends viewlet.Viewlet {
this.instantiationService.createInstance(dbgactions.StartDebugAction, dbgactions.StartDebugAction.ID, dbgactions.StartDebugAction.LABEL),
this.instantiationService.createInstance(dbgactions.SelectConfigAction, dbgactions.SelectConfigAction.ID, dbgactions.SelectConfigAction.LABEL),
this.instantiationService.createInstance(dbgactions.ConfigureAction, dbgactions.ConfigureAction.ID, dbgactions.ConfigureAction.LABEL),
this.instantiationService.createInstance(dbgactions.OpenReplAction, dbgactions.OpenReplAction.ID, dbgactions.OpenReplAction.LABEL)
this.instantiationService.createInstance(dbgactions.ToggleReplAction, dbgactions.ToggleReplAction.ID, dbgactions.ToggleReplAction.LABEL)
];
this.actions.forEach(a => {
......
......@@ -72,7 +72,7 @@
background: url('configure.svg') center center no-repeat;
}
.monaco-workbench .debug-action.open-repl {
.monaco-workbench .debug-action.toggle-repl {
background: url('repl.svg') center center no-repeat;
}
......@@ -269,7 +269,7 @@
background: url('configure-inverse.svg') center center no-repeat;
}
.monaco-workbench.vs-dark .debug-action.open-repl {
.monaco-workbench.vs-dark .debug-action.toggle-repl {
background: url('repl-inverse.svg') center center no-repeat;
}
......@@ -336,7 +336,7 @@
width: 16px;
}
.monaco-workbench.hc-black .debug-action.open-repl:before {
.monaco-workbench.hc-black .debug-action.toggle-repl:before {
content: url('repl-inverse.svg');
}
......
......@@ -99,7 +99,7 @@ registry.registerWorkbenchAction(new SyncActionDescriptor(dbgactions.StopDebugAc
registry.registerWorkbenchAction(new SyncActionDescriptor(dbgactions.ContinueAction, dbgactions.ContinueAction.ID, dbgactions.ContinueAction.LABEL, { primary: KeyCode.F5 }, KbExpr.has(debug.CONTEXT_IN_DEBUG_MODE)), debugCategory);
registry.registerWorkbenchAction(new SyncActionDescriptor(dbgactions.PauseAction, dbgactions.PauseAction.ID, dbgactions.PauseAction.LABEL), debugCategory);
registry.registerWorkbenchAction(new SyncActionDescriptor(dbgactions.ConfigureAction, dbgactions.ConfigureAction.ID, dbgactions.ConfigureAction.LABEL), debugCategory);
registry.registerWorkbenchAction(new SyncActionDescriptor(dbgactions.OpenReplAction, dbgactions.OpenReplAction.ID, dbgactions.OpenReplAction.LABEL), debugCategory);
registry.registerWorkbenchAction(new SyncActionDescriptor(dbgactions.ToggleReplAction, dbgactions.ToggleReplAction.ID, dbgactions.ToggleReplAction.LABEL), debugCategory);
// register service
registerSingleton(IDebugService, service.DebugService);
......@@ -15,6 +15,9 @@ import platform = require('vs/platform/platform');
import wbaregistry = require('vs/workbench/common/actionRegistry');
import debug = require('vs/workbench/parts/debug/common/debug');
import model = require('vs/workbench/parts/debug/common/debugModel');
import { Repl } from 'vs/workbench/parts/debug/browser/repl';
import { IPartService } from 'vs/workbench/services/part/common/partService';
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
import { IViewletService } from 'vs/workbench/services/viewlet/common/viewletService';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybindingService';
......@@ -626,16 +629,27 @@ export class RemoveAllWatchExpressionsAction extends AbstractDebugAction {
}
}
export class OpenReplAction extends actions.Action {
static ID = 'workbench.debug.action.openRepl';
static LABEL = nls.localize('openRepl', "Open Console");
export class ToggleReplAction extends actions.Action {
static ID = 'workbench.debug.action.toggleRepl';
static LABEL = nls.localize('toggleRepl', "Debug Console");
constructor(id: string, label: string, @IDebugService private debugService: IDebugService) {
super(id, label, 'debug-action open-repl', true);
constructor(id: string, label: string,
@IDebugService private debugService: IDebugService,
@IPartService private partService: IPartService,
@IPanelService private panelService: IPanelService
) {
super(id, label, 'debug-action toggle-repl', true);
this.enabled = this.debugService.getState() !== debug.State.Disabled;
}
public run(): Promise {
const panel = this.panelService.getActivePanel();
if (panel && panel.getId() === Repl.ID) {
this.partService.setPanelHidden(true);
return Promise.as(null);
}
return this.debugService.revealRepl();
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册