From 2a9a512ee4e4cd57f21551533c662cc612b831c4 Mon Sep 17 00:00:00 2001 From: isidor Date: Fri, 28 Aug 2020 14:54:16 +0200 Subject: [PATCH] debug: react on registration to update context keys --- .../contrib/debug/browser/debugConfigurationManager.ts | 2 +- src/vs/workbench/contrib/debug/browser/debugService.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.ts b/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.ts index b1d483a7755..e28eaf83505 100644 --- a/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.ts +++ b/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.ts @@ -99,6 +99,7 @@ export class ConfigurationManager implements IConfigurationManager { registerDebugAdapterFactory(debugTypes: string[], debugAdapterLauncher: IDebugAdapterFactory): IDisposable { debugTypes.forEach(debugType => this.debugAdapterFactories.set(debugType, debugAdapterLauncher)); this.debuggersAvailable.set(this.debugAdapterFactories.size > 0); + this._onDidRegisterDebugger.fire(); return { dispose: () => { @@ -425,7 +426,6 @@ export class ConfigurationManager implements IConfigurationManager { }); this.setCompoundSchemaValues(); - this._onDidRegisterDebugger.fire(); }); breakpointsExtPoint.setHandler((extensions, delta) => { diff --git a/src/vs/workbench/contrib/debug/browser/debugService.ts b/src/vs/workbench/contrib/debug/browser/debugService.ts index 7f5e9a6e2a0..76d3fd1d18f 100644 --- a/src/vs/workbench/contrib/debug/browser/debugService.ts +++ b/src/vs/workbench/contrib/debug/browser/debugService.ts @@ -160,7 +160,7 @@ export class DebugService implements IDebugService { this.toDispose.push(this.viewModel.onDidFocusSession(() => { this.onStateChange(); })); - this.toDispose.push(this.configurationManager.onDidSelectConfiguration(() => { + this.toDispose.push(Event.any(this.configurationManager.onDidRegisterDebugger, this.configurationManager.onDidSelectConfiguration)(() => { this.debugUx.set(!!(this.state !== State.Inactive || (this.configurationManager.selectedConfiguration.name && this.configurationManager.hasDebuggers())) ? 'default' : 'simple'); })); this.toDispose.push(this.model.onDidChangeCallStack(() => { -- GitLab