607
608
private mergeDefaultConfigurationsForConfigurationProperty(propertyKey: string, value: unknown, valuesSource: ConfigurationDefaultSource | undefined, existingDefaultOverride: IConfigurationDefaultOverrideValue | undefined): IConfigurationDefaultOverrideValue | undefined {
610
>
const existingDefaultValue = existingDefaultOverride?.value ?? property?.defaultDefaultValue;
611
>
let source: ConfigurationDefaultValueSource | undefined = valuesSource;
612
>
613
>
const isObjectSetting = types.isObject(value) &&
614
>
(
615
>
property !== undefined && property.type === 'object' ||
616
property === undefined && (types.isUndefined(existingDefaultValue) || types.isObject(existingDefaultValue))
618
>
619
>
// If the default value is an object, merge the objects and store the source of each keys
620
>
if (isObjectSetting) {
621
>
source = existingDefaultOverride?.source ?? new Map<string, ConfigurationDefaultSource>();
622
>
623
>
// This should not happen
624
>
if (!(source instanceof Map)) {
625
console.error('defaultValueSource is not a Map');
626
return undefined;
627
}
629
>
for (const objectKey in (value as IStringDictionary<unknown>)) {
630
>
if (valuesSource) {
631
source.set(`${propertyKey}.${objectKey}`, valuesSource);
632
}
634
>
value = { ...(types.isObject(existingDefaultValue) ? existingDefaultValue : {}), ...(value as IStringDictionary<unknown>) };
635
>
}
636
>
637
>
return { value, source };
638
>
}
639
640
public deltaConfiguration(delta: IConfigurationDelta): void {