diff --git a/packages/core/src/browser/icon-theme-service.ts b/packages/core/src/browser/icon-theme-service.ts index 7808401e209d5..862890df9718e 100644 --- a/packages/core/src/browser/icon-theme-service.ts +++ b/packages/core/src/browser/icon-theme-service.ts @@ -198,9 +198,11 @@ export class IconThemeService { const preference = this.schemaProvider.getSchemaProperty(ICON_THEME_PREFERENCE_KEY); if (preference) { const sortedThemes = Array.from(this.definitions).sort((a, b) => a.label.localeCompare(b.label)); - preference.enum = sortedThemes.map(e => e.id); - preference.enumItemLabels = sortedThemes.map(e => e.label); - this.schemaProvider.updateSchemaProperty(ICON_THEME_PREFERENCE_KEY, preference); + this.schemaProvider.updateSchemaProperty(ICON_THEME_PREFERENCE_KEY, { + ...preference, + enum: sortedThemes.map(e => e.id), + enumItemLabels: sortedThemes.map(e => e.label) + }); } } diff --git a/packages/core/src/browser/preferences/preference-contribution.ts b/packages/core/src/browser/preferences/preference-contribution.ts index 6c58ef88ffb06..b91b71aff265f 100644 --- a/packages/core/src/browser/preferences/preference-contribution.ts +++ b/packages/core/src/browser/preferences/preference-contribution.ts @@ -360,6 +360,10 @@ export class PreferenceSchemaProvider extends PreferenceProvider { return this.combinedSchema.properties[key]; } + /** + * {@link property} will be assigned to field {@link key} in the schema. + * Pass a new object to invalidate old schema. + */ updateSchemaProperty(key: string, property: PreferenceDataProperty): void { this.updateSchemaProps(key, property); this.fireDidPreferenceSchemaChanged(); diff --git a/packages/core/src/browser/theming.ts b/packages/core/src/browser/theming.ts index 2a8e90b0d68db..ddcc47991ee28 100644 --- a/packages/core/src/browser/theming.ts +++ b/packages/core/src/browser/theming.ts @@ -91,9 +91,11 @@ export class ThemeService { const preference = this.schemaProvider.getSchemaProperty(COLOR_THEME_PREFERENCE_KEY); if (preference) { const sortedThemes = this.getThemes().sort((a, b) => a.label.localeCompare(b.label)); - preference.enum = sortedThemes.map(e => e.id); - preference.enumItemLabels = sortedThemes.map(e => e.label); - this.schemaProvider.updateSchemaProperty(COLOR_THEME_PREFERENCE_KEY, preference); + this.schemaProvider.updateSchemaProperty(COLOR_THEME_PREFERENCE_KEY, { + ...preference, + enum: sortedThemes.map(e => e.id), + enumItemLabels: sortedThemes.map(e => e.label) + }); } }