提交 f07a1989 编写于 作者: I isidor

debug: simplify context keys computation

fixes #54378
上级 0ef2155f
......@@ -36,9 +36,9 @@ export const BREAKPOINTS_VIEW_ID = 'workbench.debug.breakPointsView';
export const REPL_ID = 'workbench.panel.repl';
export const DEBUG_SERVICE_ID = 'debugService';
export const CONTEXT_DEBUG_TYPE = new RawContextKey<string>('debugType', undefined);
export const CONTEXT_DEBUG_STATE = new RawContextKey<string>('debugState', undefined);
export const CONTEXT_IN_DEBUG_MODE = new RawContextKey<boolean>('inDebugMode', false);
export const CONTEXT_NOT_IN_DEBUG_MODE: ContextKeyExpr = CONTEXT_IN_DEBUG_MODE.toNegated();
export const CONTEXT_DEBUG_STATE = new RawContextKey<string>('debugState', 'inactive');
export const CONTEXT_NOT_IN_DEBUG_MODE = CONTEXT_DEBUG_STATE.isEqualTo('inactive');
export const CONTEXT_IN_DEBUG_MODE = CONTEXT_DEBUG_STATE.notEqualsTo('inactive');
export const CONTEXT_IN_DEBUG_REPL = new RawContextKey<boolean>('inDebugRepl', false);
export const CONTEXT_NOT_IN_DEBUG_REPL: ContextKeyExpr = CONTEXT_IN_DEBUG_REPL.toNegated();
export const CONTEXT_BREAKPOINT_WIDGET_VISIBLE = new RawContextKey<boolean>('breakpointWidgetVisible', false);
......
......@@ -76,7 +76,6 @@ export class DebugService implements debug.IDebugService {
private configurationManager: ConfigurationManager;
private toDispose: lifecycle.IDisposable[];
private toDisposeOnSessionEnd: Map<string, lifecycle.IDisposable[]>;
private inDebugMode: IContextKey<boolean>;
private debugType: IContextKey<string>;
private debugState: IContextKey<string>;
private breakpointsToSendOnResourceSaved: Set<string>;
......@@ -120,7 +119,6 @@ export class DebugService implements debug.IDebugService {
this.configurationManager = this.instantiationService.createInstance(ConfigurationManager);
this.toDispose.push(this.configurationManager);
this.inDebugMode = debug.CONTEXT_IN_DEBUG_MODE.bindTo(contextKeyService);
this.debugType = debug.CONTEXT_DEBUG_TYPE.bindTo(contextKeyService);
this.debugState = debug.CONTEXT_DEBUG_STATE.bindTo(contextKeyService);
......@@ -909,7 +907,6 @@ export class DebugService implements debug.IDebugService {
const resolved = configuration.resolved;
resolved.__sessionId = sessionId;
this.inDebugMode.set(true);
const dbg = this.configurationManager.getDebugger(resolved.type);
return this.initializeRawSession(root, configuration, sessionId).then(session => {
......@@ -985,9 +982,6 @@ export class DebugService implements debug.IDebugService {
if (this.model.getReplElements().length > 0) {
this.panelService.openPanel(debug.REPL_ID, false).done(undefined, errors.onUnexpectedError);
}
if (this.model.getSessions().length === 0) {
this.inDebugMode.reset();
}
this.showError(errorMessage, errors.isErrorWithActions(error) ? error.actions : []);
return undefined;
......@@ -1209,7 +1203,6 @@ export class DebugService implements debug.IDebugService {
this.updateStateAndEmit(raw.getId(), debug.State.Inactive);
if (this.model.getSessions().length === 0) {
this.inDebugMode.reset();
this.debugType.reset();
this.viewModel.setMultiSessionView(false);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册