Change:
Type: <bBug</bI'm developing an extension for VSCode and found out that I can't enable Dynamic Debug Configurations unless I include in the list of activation events. I have tried not including this activation event but having my extension activated through other means (like activated on language), but the feature doesn't work. Only when I include , this feature works. My extension is now working properly, but I wouldn't be surprised if this prevents other extension developers from using this feature. I have found this very old post of someone who might have had that exact same issue VS Code version: Code 1.84.2 (Universal) (, 2023-11-09T10:52:33.687Z) OS version: Darwin arm64 23.1.0 Modes: <details<summarySystem Info</summary </details<details<summaryExtensions (36)</summaryExtensionVersion ------ vscode-markdownlint0.52.0 gitlens14.5.0 prettier-vscode10.1.0 custom-local-formatters0.0.6 vscode-clangd0.1.24 vscode-mlir0.0.11 rainbow-csv3.8.0 vscode-mojo5.0.4-dev csdevkit1.0.14 csharp2.10.28 vscode-dotnet-runtime2.0.0 vscodeintellicode-csharp0.1.26 black-formatter2023.6.0 isort2023.10.1 python2023.20.0 vscode-pylance2023.11.10 jupyter2023.10. jupyter-keymap1.1.2 jupyter-renderers1.0.17 vscode-jupyter-cell-tags0.1.8 vscode-jupyter-slideshow0.1.5 remote-containers0.321.0 remote-ssh0.107.0 remote-ssh-edit0.86.0 remote-wsl0.81.8 vscode-remote-extensionpack0.24.0 cpptools1.18.5 cpptools-extension-pack1.3.0 remote-explorer0.4.1 remote-server1.5.0 reflow-paragraph1.3.0 errorlens3.15.0 vscode-icons12.6.0 vim1.27.0 clang-format1.9.0 markdown-all-in-one3.5.1 (1 theme extensions excluded) </details<details<summaryA/B Experiments</summary</details<!-- generated by issue reporter --
Can you explain a bit more what doesn't work?
, thanks for looking into this. I have an extension with a working debugger feature via file. I'm trying to register a DebugConfigurationProvider with kind = that implements . And, unless, I add as an activation event, my new provider doesn't get invoked at all and I don't see an entry for my debugger in the selector of the Debug View. I have confirmed that my extension was initialized right after VSCode is launched. It's as if this kind of provider is only enabled if the activation event is present.
There's some discussion about this in you've touched this too, should this be changed or just documented in
I think changing it is fine. An extension should register an activation for it, but this isn't something we enforce for any other API. Will take care of it.

Discussion:
selectBoxContainer.style.borderLeft = `1px solid ${asCssVariable(selectBorder)}`; this.container.style.backgroundColor = asCssVariable(selectBackground); <del> this.debugService.getConfigurationManager().getDynamicProviders().then(providers => { this.providers = providers; if (this.providers.length > 0) { </del> <ins> const configManager = this.debugService.getConfigurationManager(); const updateDynamicConfigs = () => configManager.getDynamicProviders().then(providers => { if (providers.length !== this.providers.length) { this.providers = providers; </ins> this.updateOptions(); } }); <ins> this.toDispose.push(configManager.onDidChangeConfigurationProviders(updateDynamicConfigs)); updateDynamicConfigs(); </ins> this.updateOptions(); }

import { DisposableStore, IDisposable, dispose } from 'vs/base/common/lifecycle'; import * as objects from 'vs/base/common/objects'; import * as resources from 'vs/base/common/resources'; <ins> import { ThemeIcon } from 'vs/base/common/themables'; </ins> import { URI as uri } from 'vs/base/common/uri'; import * as nls from 'vs/nls'; import { ConfigurationTarget, IConfigurationService } from 'vs/platform/configuration/common/configuration';

import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput'; import { Registry } from 'vs/platform/registry/common/platform'; import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; <del> import { ThemeIcon } from 'vs/base/common/themables'; </del> import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; import { IWorkspaceContextService, IWorkspaceFolder, IWorkspaceFoldersChangeEvent, WorkbenchState } from 'vs/platform/workspace/common/workspace'; import { IEditorPane } from 'vs/workbench/common/editor';

private readonly _onDidSelectConfigurationName = new Emitter<void>(); private configProviders: IDebugConfigurationProvider[]; private debugConfigurationTypeContext: IContextKey<string>; <ins> private readonly _onDidChangeConfigurationProviders = new Emitter<void>(); public readonly onDidChangeConfigurationProviders = this._onDidChangeConfigurationProviders.event; </ins> constructor( private readonly adapterManager: IAdapterManager,

@IContextKeyService contextKeyService: IContextKeyService ) { this.configProviders = []; <del> this.toDispose = []; </del> <ins> this.toDispose = [this._onDidChangeConfigurationProviders]; </ins> this.initLaunches(); this.setCompoundSchemaValues(); this.registerListeners();

registerDebugConfigurationProvider(debugConfigurationProvider: IDebugConfigurationProvider): IDisposable { this.configProviders.push(debugConfigurationProvider); <ins> this._onDidChangeConfigurationProviders.fire(); </ins> return { dispose: () => { this.unregisterDebugConfigurationProvider(debugConfigurationProvider); <ins> this._onDidChangeConfigurationProviders.fire(); </ins> } }; }

} if (explicitTypes.length) { <del> return acc.concat(explicitTypes); } if (hasGenericEvent) { </del> <ins> explicitTypes.forEach(t => acc.add(t)); } else if (hasGenericEvent) { </ins> const debuggerType = e.contributes?.debuggers?.[0].type; <del> return debuggerType ? acc.concat(debuggerType) : acc; </del> <ins> if (debuggerType) { acc.add(debuggerType); } </ins> } return acc; <del> }, [] as string[]); </del> <ins> }, new Set<string>()); for (const configProvider of this.configProviders) { if (configProvider.triggerKind === DebugConfigurationProviderTriggerKind.Dynamic) { debugDynamicExtensionsTypes.add(configProvider.type); } } </ins> <del> return debugDynamicExtensionsTypes.map(type => { </del> <ins> return [...debugDynamicExtensionsTypes].map(type => { </ins> return { label: this.adapterManager.getDebuggerLabel(type)!, getProvider: async () => {

*/ onDidSelectConfiguration: Event<void>; <ins> /** * Allows to register on change of selected debug configuration. */ onDidChangeConfigurationProviders: Event<void>; </ins> hasDebugConfigurationProvider(debugType: string, triggerKind?: DebugConfigurationProviderTriggerKind): boolean; getDynamicProviders(): Promise<{ label: string; type: string; pick: () => Promise<{ launch: ILaunch; config: IConfig } | undefined> }[]>;