configurationRegistry.ts ×9

Frontier kind: Code frontier

unlabeled · c_faa7c25609e3

930 tests · 5687 LOC · 28 files · introduces 0 tests · 65 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges65 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
738 ranges5687 lines · 28 files · Browse complete extent
All tests (intent)
930 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 65 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/configuration/common/configurationRegistry.ts 60 introduced LOC · 9 ranges

Open complete file

450 // Configuration defaults for Override Identifiers
451 if (OVERRIDE_PROPERTY_REGEX.test(key)) {
452 > const newDefaultOverride = this.mergeDefaultConfigurationsForOverrideIdentifier(key, value as IStringDictionary<unknown>, source, configurationDefaultOverridesForKey.configurationDefaultOverrideValue); configurationRegistry.ts
453 > if (!newDefaultOverride) {
454 continue;
455 }
457 > configurationDefaultOverridesForKey.configurationDefaultOverrideValue = newDefaultOverride;
458 > this.updateDefaultOverrideProperty(key, newDefaultOverride, source);
459 > overrideIdentifiers.push(...overrideIdentifiersFromKey(key));
460 > }
461
462 // Configuration defaults for Configuration Properties
546
547 private updateDefaultOverrideProperty(key: string, newDefaultOverride: IConfigurationDefaultOverrideValue, source: ConfigurationDefaultSource | undefined): void {
548 > const property: IRegisteredConfigurationPropertySchema = { configurationRegistry.ts
549 > section: {
550 > id: this.defaultLanguageConfigurationOverridesNode.id,
551 > title: this.defaultLanguageConfigurationOverridesNode.title,
552 > order: this.defaultLanguageConfigurationOverridesNode.order,
553 > extensionInfo: this.defaultLanguageConfigurationOverridesNode.extensionInfo
554 > },
555 > type: 'object',
556 > default: newDefaultOverride.value,
557 > description: nls.localize('defaultLanguageConfiguration.description', "Configure settings to be overridden for {0}.", getLanguageTagSettingPlainKey(key)),
558 > $ref: resourceLanguageSettingsSchemaId,
559 > defaultDefaultValue: newDefaultOverride.value,
560 > source,
561 > defaultValueSource: source
562 > };
563 > this.configurationProperties[key] = property;
564 > this.defaultLanguageConfigurationOverridesNode.properties![key] = property;
565 > }
566
567 private mergeDefaultConfigurationsForOverrideIdentifier(overrideIdentifier: string, configurationValueObject: IStringDictionary<unknown>, valueSource: ConfigurationDefaultSource | undefined, existingDefaultOverride: IConfigurationDefaultOverrideValue | undefined): IConfigurationDefaultOverrideValue | undefined {
568 > const defaultValue = existingDefaultOverride?.value || {}; configurationRegistry.ts
569 > const source = existingDefaultOverride?.source ?? new Map<string, ConfigurationDefaultSource>();
570 >
571 > // This should not happen
572 > if (!(source instanceof Map)) {
573 console.error('objectConfigurationSources is not a Map');
574 return undefined;
575 }
577 > for (const propertyKey of Object.keys(configurationValueObject)) {
578 > const propertyDefaultValue = configurationValueObject[propertyKey];
579 >
580 > const isObjectSetting = types.isObject(propertyDefaultValue) &&
581 (types.isUndefined((defaultValue as IStringDictionary<unknown>)[propertyKey]) || types.isObject((defaultValue as IStringDictionary<unknown>)[propertyKey]));
583 > // If the default value is an object, merge the objects and store the source of each keys
584 > if (isObjectSetting) {
585 (defaultValue as IStringDictionary<unknown>)[propertyKey] = { ...((defaultValue as IStringDictionary<unknown>)[propertyKey] ?? {}), ...propertyDefaultValue };
586 // Track the source of each value in the object
601 }
602 }
604 >
605 > return { value: defaultValue, source };
606 > }
607
608 private mergeDefaultConfigurationsForConfigurationProperty(propertyKey: string, value: unknown, valuesSource: ConfigurationDefaultSource | undefined, existingDefaultOverride: IConfigurationDefaultOverrideValue | undefined): IConfigurationDefaultOverrideValue | undefined {
674 private doRegisterOverrideIdentifiers(overrideIdentifiers: string[]) {
675 for (const overrideIdentifier of overrideIdentifiers) {
676 > this.overrideIdentifiers.add(overrideIdentifier); configurationRegistry.ts
677 > }
678 this.updateOverridePropertyPatternKey();
679 }
920 private updateOverridePropertyPatternKey(): void {
921 for (const overrideIdentifier of this.overrideIdentifiers.values()) {
922 > const overrideIdentifierProperty = `[${overrideIdentifier}]`; configurationRegistry.ts
923 > const resourceLanguagePropertiesSchema: IJSONSchema = {
924 > type: 'object',
925 > description: nls.localize('overrideSettings.defaultDescription', "Configure editor settings to be overridden for a language."),
926 > errorMessage: nls.localize('overrideSettings.errorMessage', "This setting does not support per-language configuration."),
927 > $ref: resourceLanguageSettingsSchemaId,
928 > };
929 > this.updatePropertyDefaultValue(overrideIdentifierProperty, resourceLanguagePropertiesSchema);
930 > allSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema;
931 > applicationSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema;
932 > applicationMachineSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema;
933 > machineSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema;
934 > machineOverridableSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema;
935 > windowSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema;
936 > resourceSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema;
937 > }
938 }
939
src/vs/platform/configuration/common/configuration.ts 5 introduced LOC · 1 range

Open complete file

352
353 export function getLanguageTagSettingPlainKey(settingKey: string) {
354 > return settingKey configuration.ts
355 > .replace(/^\[/, '')
356 > .replace(/]$/g, '')
357 > .replace(/\]\[/g, ', ');
358 > }