diff --git a/src/vs/workbench/parts/debug/browser/debugViewlet.ts b/src/vs/workbench/parts/debug/browser/debugViewlet.ts index 373f24098b13a1278a61ef435974558ab2637818..adf6878eb97c399ef5c84feeb6036e33d2727c96 100644 --- a/src/vs/workbench/parts/debug/browser/debugViewlet.ts +++ b/src/vs/workbench/parts/debug/browser/debugViewlet.ts @@ -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 => { diff --git a/src/vs/workbench/parts/debug/browser/media/debug.contribution.css b/src/vs/workbench/parts/debug/browser/media/debug.contribution.css index 4ac77f7a1466721c33c60193b02185cbfa062cb1..267960e4926dbdf7fba45eac2709da7d9d2a4324 100644 --- a/src/vs/workbench/parts/debug/browser/media/debug.contribution.css +++ b/src/vs/workbench/parts/debug/browser/media/debug.contribution.css @@ -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'); } diff --git a/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts b/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts index 7840f714b71f3c5f441e71e997abadc839cab984..063112d1d7a47294b5ede0426eab7d01e8c7b7d4 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts @@ -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); diff --git a/src/vs/workbench/parts/debug/electron-browser/debugActions.ts b/src/vs/workbench/parts/debug/electron-browser/debugActions.ts index c7b420dd4dd0ac5416fa5fdab4b93271ed49d132..3d3b941acb7bc7aef1a2d1febadce9699250141c 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugActions.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugActions.ts @@ -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(); } }