546
547
private updateDefaultOverrideProperty(key: string, newDefaultOverride: IConfigurationDefaultOverrideValue, source: ConfigurationDefaultSource | undefined): void {
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 {
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