From aa2c164259d145faea92af3488284eeca36deba4 Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 8 Feb 2017 17:28:01 +0100 Subject: [PATCH] debug: introduce debug type context fixes #19608 --- src/vs/workbench/parts/debug/common/debug.ts | 1 + src/vs/workbench/parts/debug/electron-browser/debugService.ts | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/vs/workbench/parts/debug/common/debug.ts b/src/vs/workbench/parts/debug/common/debug.ts index 18b00b7f1fd..837eae6b36f 100644 --- a/src/vs/workbench/parts/debug/common/debug.ts +++ b/src/vs/workbench/parts/debug/common/debug.ts @@ -20,6 +20,7 @@ import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/edi export const VIEWLET_ID = 'workbench.view.debug'; export const REPL_ID = 'workbench.panel.repl'; export const DEBUG_SERVICE_ID = 'debugService'; +export const CONTEXT_DEBUG_TYPE = new RawContextKey('debugType', undefined); export const CONTEXT_IN_DEBUG_MODE = new RawContextKey('inDebugMode', false); export const CONTEXT_NOT_IN_DEBUG_MODE: ContextKeyExpr = CONTEXT_IN_DEBUG_MODE.toNegated(); export const CONTEXT_IN_DEBUG_REPL = new RawContextKey('inDebugRepl', false); diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index 21fb5995e07..dc0525e7a2d 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -69,6 +69,7 @@ export class DebugService implements debug.IDebugService { private toDispose: lifecycle.IDisposable[]; private toDisposeOnSessionEnd: Map; private inDebugMode: IContextKey; + private debugType: IContextKey; private breakpointsToSendOnResourceSaved: Set; constructor( @@ -100,6 +101,7 @@ export class DebugService implements debug.IDebugService { this.configurationManager = this.instantiationService.createInstance(ConfigurationManager); this.inDebugMode = debug.CONTEXT_IN_DEBUG_MODE.bindTo(contextKeyService); + this.debugType = debug.CONTEXT_DEBUG_TYPE.bindTo(contextKeyService); this.model = new Model(this.loadBreakpoints(), this.storageService.getBoolean(DEBUG_BREAKPOINTS_ACTIVATED_KEY, StorageScope.WORKSPACE, true), this.loadFunctionBreakpoints(), this.loadExceptionBreakpoints(), this.loadWatchExpressions()); @@ -713,6 +715,7 @@ export class DebugService implements debug.IDebugService { } this.extensionService.activateByEvent(`onDebug:${configuration.type}`).done(null, errors.onUnexpectedError); this.inDebugMode.set(true); + this.debugType.set(configuration.type); if (this.model.getProcesses().length > 1) { this.viewModel.setMultiProcessView(true); } @@ -874,6 +877,7 @@ export class DebugService implements debug.IDebugService { this.model.updateBreakpoints(data); this.inDebugMode.reset(); + this.debugType.reset(); this.viewModel.setMultiProcessView(false); if (this.partService.isVisible(Parts.SIDEBAR_PART) && this.configurationService.getConfiguration('debug').openExplorerOnEnd) { -- GitLab