@@ -12,6 +12,7 @@ import { IJSONSchema } from 'vs/base/common/jsonSchema';
12
12
import { DisposableStore , IDisposable , dispose } from 'vs/base/common/lifecycle' ;
13
13
import * as objects from 'vs/base/common/objects' ;
14
14
import * as resources from 'vs/base/common/resources' ;
15
+ import { ThemeIcon } from 'vs/base/common/themables' ;
15
16
import { URI as uri } from 'vs/base/common/uri' ;
16
17
import * as nls from 'vs/nls' ;
17
18
import { ConfigurationTarget , IConfigurationService } from 'vs/platform/configuration/common/configuration' ;
@@ -22,7 +23,6 @@ import { IJSONContributionRegistry, Extensions as JSONExtensions } from 'vs/plat
22
23
import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput' ;
23
24
import { Registry } from 'vs/platform/registry/common/platform' ;
24
25
import { IStorageService , StorageScope , StorageTarget } from 'vs/platform/storage/common/storage' ;
25
- import { ThemeIcon } from 'vs/base/common/themables' ;
26
26
import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity' ;
27
27
import { IWorkspaceContextService , IWorkspaceFolder , IWorkspaceFoldersChangeEvent , WorkbenchState } from 'vs/platform/workspace/common/workspace' ;
28
28
import { IEditorPane } from 'vs/workbench/common/editor' ;
@@ -59,6 +59,8 @@ export class ConfigurationManager implements IConfigurationManager {
59
59
private readonly _onDidSelectConfigurationName = new Emitter < void > ( ) ;
60
60
private configProviders : IDebugConfigurationProvider [ ] ;
61
61
private debugConfigurationTypeContext : IContextKey < string > ;
62
+ private readonly _onDidChangeConfigurationProviders = new Emitter < void > ( ) ;
63
+ public readonly onDidChangeConfigurationProviders = this . _onDidChangeConfigurationProviders . event ;
62
64
63
65
constructor (
64
66
private readonly adapterManager : IAdapterManager ,
@@ -73,7 +75,7 @@ export class ConfigurationManager implements IConfigurationManager {
73
75
@IContextKeyService contextKeyService : IContextKeyService
74
76
) {
75
77
this . configProviders = [ ] ;
76
- this . toDispose = [ ] ;
78
+ this . toDispose = [ this . _onDidChangeConfigurationProviders ] ;
77
79
this . initLaunches ( ) ;
78
80
this . setCompoundSchemaValues ( ) ;
79
81
this . registerListeners ( ) ;
@@ -92,9 +94,11 @@ export class ConfigurationManager implements IConfigurationManager {
92
94
93
95
registerDebugConfigurationProvider ( debugConfigurationProvider : IDebugConfigurationProvider ) : IDisposable {
94
96
this . configProviders . push ( debugConfigurationProvider ) ;
97
+ this . _onDidChangeConfigurationProviders . fire ( ) ;
95
98
return {
96
99
dispose : ( ) => {
97
100
this . unregisterDebugConfigurationProvider ( debugConfigurationProvider ) ;
101
+ this . _onDidChangeConfigurationProviders . fire ( ) ;
98
102
}
99
103
} ;
100
104
}
@@ -187,18 +191,24 @@ export class ConfigurationManager implements IConfigurationManager {
187
191
}
188
192
189
193
if ( explicitTypes . length ) {
190
- return acc . concat ( explicitTypes ) ;
191
- }
192
-
193
- if ( hasGenericEvent ) {
194
+ explicitTypes . forEach ( t => acc . add ( t ) ) ;
195
+ } else if ( hasGenericEvent ) {
194
196
const debuggerType = e . contributes ?. debuggers ?. [ 0 ] . type ;
195
- return debuggerType ? acc . concat ( debuggerType ) : acc ;
197
+ if ( debuggerType ) {
198
+ acc . add ( debuggerType ) ;
199
+ }
196
200
}
197
201
198
202
return acc ;
199
- } , [ ] as string [ ] ) ;
203
+ } , new Set < string > ( ) ) ;
204
+
205
+ for ( const configProvider of this . configProviders ) {
206
+ if ( configProvider . triggerKind === DebugConfigurationProviderTriggerKind . Dynamic ) {
207
+ debugDynamicExtensionsTypes . add ( configProvider . type ) ;
208
+ }
209
+ }
200
210
201
- return debugDynamicExtensionsTypes . map ( type => {
211
+ return [ ... debugDynamicExtensionsTypes ] . map ( type => {
202
212
return {
203
213
label : this . adapterManager . getDebuggerLabel ( type ) ! ,
204
214
getProvider : async ( ) => {
0 commit comments