@@ -11,6 +11,7 @@ import * as types from 'vs/base/common/types';
1111import * as strings from 'vs/base/common/strings' ;
1212import { IJSONContributionRegistry , Extensions as JSONExtensions } from 'vs/platform/jsonschemas/common/jsonContributionRegistry' ;
1313import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions' ;
14+ import { values } from 'vs/base/common/map' ;
1415
1516export const Extensions = {
1617 Configuration : 'base.contributions.configuration'
@@ -157,7 +158,7 @@ class ConfigurationRegistry implements IConfigurationRegistry {
157158 private readonly configurationProperties : { [ qualifiedKey : string ] : IJSONSchema } ;
158159 private readonly excludedConfigurationProperties : { [ qualifiedKey : string ] : IJSONSchema } ;
159160 private readonly resourceLanguageSettingsSchema : IJSONSchema ;
160- private readonly overrideIdentifiers : string [ ] = [ ] ;
161+ private readonly overrideIdentifiers = new Set < string > ( ) ;
161162 private overridePropertyPattern : string ;
162163
163164 private readonly _onDidSchemaChange = new Emitter < void > ( ) ;
@@ -290,7 +291,10 @@ class ConfigurationRegistry implements IConfigurationRegistry {
290291 }
291292
292293 public registerOverrideIdentifiers ( overrideIdentifiers : string [ ] ) : void {
293- this . overrideIdentifiers . push ( ...overrideIdentifiers ) ;
294+ for ( const overrideIdentifier of overrideIdentifiers ) {
295+ this . overrideIdentifiers . add ( overrideIdentifier ) ;
296+ }
297+
294298 this . updateOverridePropertyPatternKey ( ) ;
295299 }
296300
@@ -420,7 +424,7 @@ class ConfigurationRegistry implements IConfigurationRegistry {
420424 }
421425
422426 private computeOverridePropertyPattern ( ) : string {
423- return this . overrideIdentifiers . length ? OVERRIDE_PATTERN_WITH_SUBSTITUTION . replace ( '${0}' , this . overrideIdentifiers . map ( identifier => strings . createRegExp ( identifier , false ) . source ) . join ( '|' ) ) : OVERRIDE_PROPERTY ;
427+ return this . overrideIdentifiers . size > 0 ? OVERRIDE_PATTERN_WITH_SUBSTITUTION . replace ( '${0}' , values ( this . overrideIdentifiers ) . map ( identifier => strings . createRegExp ( identifier , false ) . source ) . join ( '|' ) ) : OVERRIDE_PROPERTY ;
424428 }
425429}
426430
0 commit comments