Skip to content

Commit 8ec6ec7

Browse files
committed
rename "Trigger" to "TriggerKind"; see microsoft#88230
1 parent 75877c8 commit 8ec6ec7

8 files changed

Lines changed: 30 additions & 30 deletions

File tree

src/vs/vscode.proposed.d.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -720,12 +720,12 @@ declare module 'vscode' {
720720
//#region debug: https://github.com/microsoft/vscode/issues/88230
721721

722722
/**
723-
* A DebugConfigurationProviderTrigger specifies when the `provideDebugConfigurations` method of a `DebugConfigurationProvider` is triggered.
723+
* A DebugConfigurationProviderTriggerKind specifies when the `provideDebugConfigurations` method of a `DebugConfigurationProvider` is triggered.
724724
* Currently there are two situations: to provide the initial debug configurations for a newly created launch.json or
725725
* to provide dynamically generated debug configurations when the user asks for them through the UI (e.g. via the "Select and Start Debugging" command).
726-
* A trigger is used when registering a `DebugConfigurationProvider` with #debug.registerDebugConfigurationProvider.
726+
* A trigger kind is used when registering a `DebugConfigurationProvider` with #debug.registerDebugConfigurationProvider.
727727
*/
728-
export enum DebugConfigurationProviderTrigger {
728+
export enum DebugConfigurationProviderTriggerKind {
729729
/**
730730
* `DebugConfigurationProvider.provideDebugConfigurations` is called to provide the initial debug configurations for a newly created launch.json.
731731
*/
@@ -739,19 +739,19 @@ declare module 'vscode' {
739739
export namespace debug {
740740
/**
741741
* Register a [debug configuration provider](#DebugConfigurationProvider) for a specific debug type.
742-
* The optional [trigger](#DebugConfigurationProviderTrigger) can be used to specify when the `provideDebugConfigurations` method of the provider is triggered.
743-
* Currently two triggers are possible: with the value `Initial` (or if no trigger argument is given) the `provideDebugConfigurations` method is used to provide the initial debug configurations to be copied into a newly created launch.json.
744-
* With the trigger `Dynamic` the `provideDebugConfigurations` method is used to dynamically determine debug configurations to be presented to the user (in addition to the static configurations from the launch.json).
745-
* Please note that the `trigger` argument only applies to the `provideDebugConfigurations` method: so the `resolveDebugConfiguration` methods are not affected at all.
746-
* Registering a single provider with resolve methods for different triggers, results in the same resolve methods called multiple times.
742+
* The optional [triggerKind](#DebugConfigurationProviderTriggerKind) can be used to specify when the `provideDebugConfigurations` method of the provider is triggered.
743+
* Currently two trigger kinds are possible: with the value `Initial` (or if no trigger kind argument is given) the `provideDebugConfigurations` method is used to provide the initial debug configurations to be copied into a newly created launch.json.
744+
* With the trigger kind `Dynamic` the `provideDebugConfigurations` method is used to dynamically determine debug configurations to be presented to the user (in addition to the static configurations from the launch.json).
745+
* Please note that the `triggerKind` argument only applies to the `provideDebugConfigurations` method: so the `resolveDebugConfiguration` methods are not affected at all.
746+
* Registering a single provider with resolve methods for different trigger kinds, results in the same resolve methods called multiple times.
747747
* More than one provider can be registered for the same type.
748748
*
749749
* @param type The debug type for which the provider is registered.
750750
* @param provider The [debug configuration provider](#DebugConfigurationProvider) to register.
751-
* @param trigger The [trigger](#DebugConfigurationProviderTrigger) for which the 'provideDebugConfiguration' method of the provider is registered.
751+
* @param triggerKind The [trigger](#DebugConfigurationProviderTrigger) for which the 'provideDebugConfiguration' method of the provider is registered.
752752
* @return A [disposable](#Disposable) that unregisters this provider when being disposed.
753753
*/
754-
export function registerDebugConfigurationProvider(debugType: string, provider: DebugConfigurationProvider, trigger?: DebugConfigurationProviderTrigger): Disposable;
754+
export function registerDebugConfigurationProvider(debugType: string, provider: DebugConfigurationProvider, triggerKind?: DebugConfigurationProviderTriggerKind): Disposable;
755755
}
756756

757757
// deprecated debug API

src/vs/workbench/api/browser/mainThreadDebugService.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import severity from 'vs/base/common/severity';
1515
import { AbstractDebugAdapter } from 'vs/workbench/contrib/debug/common/abstractDebugAdapter';
1616
import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace';
1717
import { convertToVSCPaths, convertToDAPaths } from 'vs/workbench/contrib/debug/common/debugUtils';
18-
import { DebugConfigurationProviderTrigger } from 'vs/workbench/api/common/extHostTypes';
18+
import { DebugConfigurationProviderTriggerKind } from 'vs/workbench/api/common/extHostTypes';
1919

2020
@extHostNamedCustomer(MainContext.MainThreadDebugService)
2121
export class MainThreadDebugService implements MainThreadDebugServiceShape, IDebugAdapterFactory {
@@ -155,11 +155,11 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb
155155
return Promise.resolve();
156156
}
157157

158-
public $registerDebugConfigurationProvider(debugType: string, providerTrigger: DebugConfigurationProviderTrigger, hasProvide: boolean, hasResolve: boolean, hasResolve2: boolean, hasProvideDebugAdapter: boolean, handle: number): Promise<void> {
158+
public $registerDebugConfigurationProvider(debugType: string, providerTriggerKind: DebugConfigurationProviderTriggerKind, hasProvide: boolean, hasResolve: boolean, hasResolve2: boolean, hasProvideDebugAdapter: boolean, handle: number): Promise<void> {
159159

160160
const provider = <IDebugConfigurationProvider>{
161161
type: debugType,
162-
trigger: providerTrigger
162+
triggerKind: providerTriggerKind
163163
};
164164
if (hasProvide) {
165165
provider.provideDebugConfigurations = (folder, token) => {

src/vs/workbench/api/common/extHost.api.impl.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -844,8 +844,8 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
844844
onDidChangeBreakpoints(listener, thisArgs?, disposables?) {
845845
return extHostDebugService.onDidChangeBreakpoints(listener, thisArgs, disposables);
846846
},
847-
registerDebugConfigurationProvider(debugType: string, provider: vscode.DebugConfigurationProvider, trigger?: vscode.DebugConfigurationProviderTrigger) {
848-
return extHostDebugService.registerDebugConfigurationProvider(debugType, provider, trigger || extHostTypes.DebugConfigurationProviderTrigger.Initial);
847+
registerDebugConfigurationProvider(debugType: string, provider: vscode.DebugConfigurationProvider, triggerKind?: vscode.DebugConfigurationProviderTriggerKind) {
848+
return extHostDebugService.registerDebugConfigurationProvider(debugType, provider, triggerKind || extHostTypes.DebugConfigurationProviderTriggerKind.Initial);
849849
},
850850
registerDebugAdapterDescriptorFactory(debugType: string, factory: vscode.DebugAdapterDescriptorFactory) {
851851
return extHostDebugService.registerDebugAdapterDescriptorFactory(extension, debugType, factory);
@@ -1045,7 +1045,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
10451045
CallHierarchyIncomingCall: extHostTypes.CallHierarchyIncomingCall,
10461046
CallHierarchyItem: extHostTypes.CallHierarchyItem,
10471047
DebugConsoleMode: extHostTypes.DebugConsoleMode,
1048-
DebugConfigurationProviderTrigger: extHostTypes.DebugConfigurationProviderTrigger,
1048+
DebugConfigurationProviderTriggerKind: extHostTypes.DebugConfigurationProviderTriggerKind,
10491049
Decoration: extHostTypes.Decoration,
10501050
UIKind: UIKind,
10511051
ColorThemeKind: extHostTypes.ColorThemeKind,

src/vs/workbench/api/common/extHost.protocol.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ import { INotebookMimeTypeSelector, IOutput, INotebookDisplayOrder, NotebookCell
5555
import { CallHierarchyItem } from 'vs/workbench/contrib/callHierarchy/common/callHierarchy';
5656
import { Dto } from 'vs/base/common/types';
5757
import { ISerializableEnvironmentVariableCollection } from 'vs/workbench/contrib/terminal/common/environmentVariable';
58-
import { DebugConfigurationProviderTrigger } from 'vs/workbench/api/common/extHostTypes';
58+
import { DebugConfigurationProviderTriggerKind } from 'vs/workbench/api/common/extHostTypes';
5959

6060
export interface IEnvironment {
6161
isExtensionDevelopmentDebug: boolean;
@@ -846,7 +846,7 @@ export interface MainThreadDebugServiceShape extends IDisposable {
846846
$acceptDAMessage(handle: number, message: DebugProtocol.ProtocolMessage): void;
847847
$acceptDAError(handle: number, name: string, message: string, stack: string | undefined): void;
848848
$acceptDAExit(handle: number, code: number | undefined, signal: string | undefined): void;
849-
$registerDebugConfigurationProvider(type: string, trigger: DebugConfigurationProviderTrigger, hasProvideMethod: boolean, hasResolveMethod: boolean, hasResolve2Method: boolean, hasProvideDaMethod: boolean, handle: number): Promise<void>;
849+
$registerDebugConfigurationProvider(type: string, triggerKind: DebugConfigurationProviderTriggerKind, hasProvideMethod: boolean, hasResolveMethod: boolean, hasResolve2Method: boolean, hasProvideDaMethod: boolean, handle: number): Promise<void>;
850850
$registerDebugAdapterDescriptorFactory(type: string, handle: number): Promise<void>;
851851
$unregisterDebugConfigurationProvider(handle: number): void;
852852
$unregisterDebugAdapterDescriptorFactory(handle: number): void;

src/vs/workbench/api/common/extHostDebugService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export interface IExtHostDebugService extends ExtHostDebugServiceShape {
5151
addBreakpoints(breakpoints0: vscode.Breakpoint[]): Promise<void>;
5252
removeBreakpoints(breakpoints0: vscode.Breakpoint[]): Promise<void>;
5353
startDebugging(folder: vscode.WorkspaceFolder | undefined, nameOrConfig: string | vscode.DebugConfiguration, options: vscode.DebugSessionOptions): Promise<boolean>;
54-
registerDebugConfigurationProvider(type: string, provider: vscode.DebugConfigurationProvider, trigger: vscode.DebugConfigurationProviderTrigger): vscode.Disposable;
54+
registerDebugConfigurationProvider(type: string, provider: vscode.DebugConfigurationProvider, trigger: vscode.DebugConfigurationProviderTriggerKind): vscode.Disposable;
5555
registerDebugAdapterDescriptorFactory(extension: IExtensionDescription, type: string, factory: vscode.DebugAdapterDescriptorFactory): vscode.Disposable;
5656
registerDebugAdapterTrackerFactory(type: string, factory: vscode.DebugAdapterTrackerFactory): vscode.Disposable;
5757
asDebugSourceUri(source: vscode.DebugProtocolSource, session?: vscode.DebugSession): vscode.Uri;
@@ -299,7 +299,7 @@ export class ExtHostDebugServiceBase implements IExtHostDebugService, ExtHostDeb
299299
});
300300
}
301301

302-
public registerDebugConfigurationProvider(type: string, provider: vscode.DebugConfigurationProvider, trigger: vscode.DebugConfigurationProviderTrigger): vscode.Disposable {
302+
public registerDebugConfigurationProvider(type: string, provider: vscode.DebugConfigurationProvider, trigger: vscode.DebugConfigurationProviderTriggerKind): vscode.Disposable {
303303

304304
if (!provider) {
305305
return new Disposable(() => { });

src/vs/workbench/api/common/extHostTypes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2652,7 +2652,7 @@ export enum DebugConsoleMode {
26522652
MergeWithParent = 1
26532653
}
26542654

2655-
export enum DebugConfigurationProviderTrigger {
2655+
export enum DebugConfigurationProviderTriggerKind {
26562656
/**
26572657
* `DebugConfigurationProvider.provideDebugConfigurations` is called to provide the initial debug configurations for a newly created launch.json.
26582658
*/

src/vs/workbench/contrib/debug/browser/debugConfigurationManager.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import { sequence } from 'vs/base/common/async';
3838
import { IHistoryService } from 'vs/workbench/services/history/common/history';
3939
import { first } from 'vs/base/common/arrays';
4040
import { getVisibleAndSorted } from 'vs/workbench/contrib/debug/common/debugUtils';
41-
import { DebugConfigurationProviderTrigger } from 'vs/workbench/api/common/extHostTypes';
41+
import { DebugConfigurationProviderTriggerKind } from 'vs/workbench/api/common/extHostTypes';
4242

4343
const jsonRegistry = Registry.as<IJSONContributionRegistry>(JSONExtensions.JSONContribution);
4444
jsonRegistry.registerSchema(launchSchemaId, launchSchema);
@@ -197,12 +197,12 @@ export class ConfigurationManager implements IConfigurationManager {
197197
/**
198198
* if scope is not specified,a value of DebugConfigurationProvideTrigger.Initial is assumed.
199199
*/
200-
hasDebugConfigurationProvider(debugType: string, trigger?: DebugConfigurationProviderTrigger): boolean {
201-
if (trigger === undefined) {
202-
trigger = DebugConfigurationProviderTrigger.Initial;
200+
hasDebugConfigurationProvider(debugType: string, triggerKind?: DebugConfigurationProviderTriggerKind): boolean {
201+
if (triggerKind === undefined) {
202+
triggerKind = DebugConfigurationProviderTriggerKind.Initial;
203203
}
204204
// check if there are providers for the given type that contribute a provideDebugConfigurations method
205-
const providers = this.configProviders.filter(p => p.provideDebugConfigurations && (p.type === debugType) && (p.trigger === trigger));
205+
const providers = this.configProviders.filter(p => p.provideDebugConfigurations && (p.type === debugType) && (p.triggerKind === triggerKind));
206206
return providers.length > 0;
207207
}
208208

@@ -241,14 +241,14 @@ export class ConfigurationManager implements IConfigurationManager {
241241

242242
async provideDebugConfigurations(folderUri: uri | undefined, type: string, token: CancellationToken): Promise<any[]> {
243243
await this.activateDebuggers('onDebugInitialConfigurations');
244-
const results = await Promise.all(this.configProviders.filter(p => p.type === type && p.trigger === DebugConfigurationProviderTrigger.Initial && p.provideDebugConfigurations).map(p => p.provideDebugConfigurations!(folderUri, token)));
244+
const results = await Promise.all(this.configProviders.filter(p => p.type === type && p.triggerKind === DebugConfigurationProviderTriggerKind.Initial && p.provideDebugConfigurations).map(p => p.provideDebugConfigurations!(folderUri, token)));
245245

246246
return results.reduce((first, second) => first.concat(second), []);
247247
}
248248

249249
async getDynamicProviders(): Promise<{ label: string, pick: () => Promise<{ launch: ILaunch, config: IConfig } | undefined> }[]> {
250250
await this.activateDebuggers('onDebugDynamicConfigurations');
251-
const dynamicProviders = this.configProviders.filter(p => p.trigger === DebugConfigurationProviderTrigger.Dynamic && p.provideDebugConfigurations);
251+
const dynamicProviders = this.configProviders.filter(p => p.triggerKind === DebugConfigurationProviderTriggerKind.Dynamic && p.provideDebugConfigurations);
252252
return dynamicProviders.map(provider => {
253253
return {
254254
label: this.getDebuggerLabel(provider.type)!,

src/vs/workbench/contrib/debug/common/debug.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { TaskIdentifier } from 'vs/workbench/contrib/tasks/common/tasks';
2323
import { TelemetryService } from 'vs/platform/telemetry/common/telemetryService';
2424
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
2525
import { CancellationToken } from 'vs/base/common/cancellation';
26-
import { DebugConfigurationProviderTrigger } from 'vs/workbench/api/common/extHostTypes';
26+
import { DebugConfigurationProviderTriggerKind } from 'vs/workbench/api/common/extHostTypes';
2727

2828
export const VIEWLET_ID = 'workbench.view.debug';
2929

@@ -603,7 +603,7 @@ export interface IDebuggerContribution extends IPlatformSpecificAdapterContribut
603603

604604
export interface IDebugConfigurationProvider {
605605
readonly type: string;
606-
readonly trigger: DebugConfigurationProviderTrigger;
606+
readonly triggerKind: DebugConfigurationProviderTriggerKind;
607607
resolveDebugConfiguration?(folderUri: uri | undefined, debugConfiguration: IConfig, token: CancellationToken): Promise<IConfig | null | undefined>;
608608
resolveDebugConfigurationWithSubstitutedVariables?(folderUri: uri | undefined, debugConfiguration: IConfig, token: CancellationToken): Promise<IConfig | null | undefined>;
609609
provideDebugConfigurations?(folderUri: uri | undefined, token: CancellationToken): Promise<IConfig[]>;

0 commit comments

Comments
 (0)