Skip to content

Commit

Permalink
Merge pull request #196768 from WardenGnaw/dev/waan/showDynamicConfig…
Browse files Browse the repository at this point in the history
…urationsNoContext

Show Dynamic Configuration Providers with No Context (file opened)
  • Loading branch information
roblourens authored and amunger committed Nov 13, 2023
2 parents 820ca9f + c7474e2 commit 1fa2012
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,10 @@ export class AdapterManager extends Disposable implements IAdapterManager {
// Or if a breakpoint can be set in the current file (good hint that an extension can handle it)
if ((!languageLabel || gettingConfigurations || (model && this.canSetBreakpointsIn(model))) && candidates.length === 0) {
await this.activateDebuggers('onDebugInitialConfigurations');

candidates = this.debuggers
.filter(a => a.enabled)
.filter(dbg => dbg.hasInitialConfiguration() || dbg.hasConfigurationProvider());
.filter(dbg => dbg.hasInitialConfiguration() || dbg.hasDynamicConfigurationProviders() || dbg.hasConfigurationProvider());
}

if (candidates.length === 0 && languageLabel) {
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/contrib/debug/common/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ export interface IConfigurationManager {
*/
onDidSelectConfiguration: Event<void>;

hasDebugConfigurationProvider(debugType: string): boolean;
hasDebugConfigurationProvider(debugType: string, triggerKind?: DebugConfigurationProviderTriggerKind): boolean;
getDynamicProviders(): Promise<{ label: string; type: string; pick: () => Promise<{ launch: ILaunch; config: IConfig } | undefined> }[]>;

registerDebugConfigurationProvider(debugConfigurationProvider: IDebugConfigurationProvider): IDisposable;
Expand Down
6 changes: 5 additions & 1 deletion src/vs/workbench/contrib/debug/common/debugger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as nls from 'vs/nls';
import { isObject } from 'vs/base/common/types';
import { IJSONSchema, IJSONSchemaMap, IJSONSchemaSnippet } from 'vs/base/common/jsonSchema';
import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace';
import { IConfig, IDebuggerContribution, IDebugAdapter, IDebugger, IDebugSession, IAdapterManager, IDebugService, debuggerDisabledMessage, IDebuggerMetadata } from 'vs/workbench/contrib/debug/common/debug';
import { IConfig, IDebuggerContribution, IDebugAdapter, IDebugger, IDebugSession, IAdapterManager, IDebugService, debuggerDisabledMessage, IDebuggerMetadata, DebugConfigurationProviderTriggerKind } from 'vs/workbench/contrib/debug/common/debug';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver';
import * as ConfigurationResolverUtils from 'vs/workbench/services/configurationResolver/common/configurationResolverUtils';
Expand Down Expand Up @@ -176,6 +176,10 @@ export class Debugger implements IDebugger, IDebuggerMetadata {
return !!this.debuggerContribution.initialConfigurations;
}

hasDynamicConfigurationProviders(): boolean {
return this.debugService.getConfigurationManager().hasDebugConfigurationProvider(this.type, DebugConfigurationProviderTriggerKind.Dynamic);
}

hasConfigurationProvider(): boolean {
return this.debugService.getConfigurationManager().hasDebugConfigurationProvider(this.type);
}
Expand Down

0 comments on commit 1fa2012

Please sign in to comment.