From e79707e2d708ff2b97b8ec6783b8ccfffb3e973f Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 29 Apr 2020 14:19:43 +0200 Subject: [PATCH] fixes #96297 --- .../debug/browser/debugConfigurationManager.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.ts b/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.ts index d7de689cf84..16012528ff8 100644 --- a/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.ts +++ b/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.ts @@ -247,16 +247,22 @@ export class ConfigurationManager implements IConfigurationManager { } async getDynamicProviders(): Promise<{ label: string, pick: () => Promise<{ launch: ILaunch, config: IConfig } | undefined> }[]> { - await this.activateDebuggers('onDebugDynamicConfigurations'); - const dynamicProviders = this.configProviders.filter(p => p.triggerKind === DebugConfigurationProviderTriggerKind.Dynamic && p.provideDebugConfigurations); - return dynamicProviders.map(provider => { + const extensions = await this.extensionService.getExtensions(); + const debugDynamicExtensions = extensions.filter(e => { + return e.activationEvents && e.activationEvents.filter(e => e.includes('onDebugDynamicConfigurations')).length && e.contributes?.debuggers; + }); + + return debugDynamicExtensions.map(e => { + const type = e.contributes?.debuggers![0].type!; return { - label: this.getDebuggerLabel(provider.type)!, + label: this.getDebuggerLabel(type)!, pick: async () => { + await this.activateDebuggers('onDebugDynamicConfigurations', type); const token = new CancellationTokenSource(); const picks: Promise<{ label: string, launch: ILaunch, config: IConfig }[]>[] = []; + const provider = this.configProviders.filter(p => p.type === type && p.triggerKind === DebugConfigurationProviderTriggerKind.Dynamic && p.provideDebugConfigurations)[0]; this.getLaunches().forEach(launch => { - if (launch.workspace) { + if (launch.workspace && provider) { picks.push(provider.provideDebugConfigurations!(launch.workspace.uri, token.token).then(configurations => configurations.map(config => ({ label: config.name, config,