提交 366d85a4 编写于 作者: M Martin Aeschlimann

Fix use of notifyConfigurationSchemaUpdated

上级 fed4b741
...@@ -13,11 +13,10 @@ import { IWorkbenchThemeService, IColorTheme, ITokenColorCustomizations, IFileIc ...@@ -13,11 +13,10 @@ import { IWorkbenchThemeService, IColorTheme, ITokenColorCustomizations, IFileIc
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { Registry } from 'vs/platform/registry/common/platform'; import { Registry } from 'vs/platform/registry/common/platform';
import { IJSONSchema } from 'vs/base/common/jsonSchema';
import errors = require('vs/base/common/errors'); import errors = require('vs/base/common/errors');
import { IConfigurationEditingService, ConfigurationTarget } from 'vs/workbench/services/configuration/common/configurationEditing'; import { IConfigurationEditingService, ConfigurationTarget } from 'vs/workbench/services/configuration/common/configurationEditing';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry'; import { IConfigurationRegistry, Extensions as ConfigurationExtensions, IConfigurationPropertySchema, IConfigurationNode } from 'vs/platform/configuration/common/configurationRegistry';
import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { IEnvironmentService } from 'vs/platform/environment/common/environment';
import { IMessageService } from 'vs/platform/message/common/message'; import { IMessageService } from 'vs/platform/message/common/message';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
...@@ -151,12 +150,12 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { ...@@ -151,12 +150,12 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
this.colorThemeStore.onDidChange(themes => { this.colorThemeStore.onDidChange(themes => {
colorThemeSettingSchema.enum = themes.map(t => t.settingsId); colorThemeSettingSchema.enum = themes.map(t => t.settingsId);
colorThemeSettingSchema.enumDescriptions = themes.map(t => themeData.description || ''); colorThemeSettingSchema.enumDescriptions = themes.map(t => themeData.description || '');
configurationRegistry.notifyConfigurationSchemaUpdated(colorThemeSettingSchema); configurationRegistry.notifyConfigurationSchemaUpdated(themeSettingsConfiguration);
}); });
this.iconThemeStore.onDidChange(themes => { this.iconThemeStore.onDidChange(themes => {
iconThemeSettingSchema.enum = [null, ...themes.map(t => t.settingsId)]; iconThemeSettingSchema.enum = [null, ...themes.map(t => t.settingsId)];
iconThemeSettingSchema.enumDescriptions = [iconThemeSettingSchema.enumDescriptions[0], ...themes.map(t => themeData.description || '')]; iconThemeSettingSchema.enumDescriptions = [iconThemeSettingSchema.enumDescriptions[0], ...themes.map(t => themeData.description || '')];
configurationRegistry.notifyConfigurationSchemaUpdated(iconThemeSettingSchema); configurationRegistry.notifyConfigurationSchemaUpdated(themeSettingsConfiguration);
}); });
} }
...@@ -534,7 +533,7 @@ class ConfigurationWriter { ...@@ -534,7 +533,7 @@ class ConfigurationWriter {
// Configuration: Themes // Configuration: Themes
const configurationRegistry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration); const configurationRegistry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration);
const colorThemeSettingSchema: IJSONSchema = { const colorThemeSettingSchema: IConfigurationPropertySchema = {
type: 'string', type: 'string',
description: nls.localize('colorTheme', "Specifies the color theme used in the workbench."), description: nls.localize('colorTheme', "Specifies the color theme used in the workbench."),
default: DEFAULT_THEME_SETTING_VALUE, default: DEFAULT_THEME_SETTING_VALUE,
...@@ -543,7 +542,7 @@ const colorThemeSettingSchema: IJSONSchema = { ...@@ -543,7 +542,7 @@ const colorThemeSettingSchema: IJSONSchema = {
errorMessage: nls.localize('colorThemeError', "Theme is unknown or not installed."), errorMessage: nls.localize('colorThemeError', "Theme is unknown or not installed."),
}; };
const iconThemeSettingSchema: IJSONSchema = { const iconThemeSettingSchema: IConfigurationPropertySchema = {
type: ['string', 'null'], type: ['string', 'null'],
default: DEFAULT_ICON_THEME_SETTING_VALUE, default: DEFAULT_ICON_THEME_SETTING_VALUE,
description: nls.localize('iconTheme', "Specifies the icon theme used in the workbench or 'null' to not show any file icons."), description: nls.localize('iconTheme', "Specifies the icon theme used in the workbench or 'null' to not show any file icons."),
...@@ -551,7 +550,7 @@ const iconThemeSettingSchema: IJSONSchema = { ...@@ -551,7 +550,7 @@ const iconThemeSettingSchema: IJSONSchema = {
enumDescriptions: [nls.localize('noIconThemeDesc', 'No file icons')], enumDescriptions: [nls.localize('noIconThemeDesc', 'No file icons')],
errorMessage: nls.localize('iconThemeError', "File icon theme is unknown or not installed.") errorMessage: nls.localize('iconThemeError', "File icon theme is unknown or not installed.")
}; };
const colorCustomizationsSchema: IJSONSchema = { const colorCustomizationsSchema: IConfigurationPropertySchema = {
type: ['object'], type: ['object'],
description: nls.localize('workbenchColors', "Overrides colors from the currently selected color theme."), description: nls.localize('workbenchColors', "Overrides colors from the currently selected color theme."),
properties: colorThemeSchema.colorsSchema.properties, properties: colorThemeSchema.colorsSchema.properties,
...@@ -566,7 +565,7 @@ const colorCustomizationsSchema: IJSONSchema = { ...@@ -566,7 +565,7 @@ const colorCustomizationsSchema: IJSONSchema = {
}] }]
}; };
configurationRegistry.registerConfiguration({ const themeSettingsConfiguration: IConfigurationNode = {
id: 'workbench', id: 'workbench',
order: 7.1, order: 7.1,
type: 'object', type: 'object',
...@@ -575,7 +574,8 @@ configurationRegistry.registerConfiguration({ ...@@ -575,7 +574,8 @@ configurationRegistry.registerConfiguration({
[ICON_THEME_SETTING]: iconThemeSettingSchema, [ICON_THEME_SETTING]: iconThemeSettingSchema,
[CUSTOM_WORKBENCH_COLORS_SETTING]: colorCustomizationsSchema [CUSTOM_WORKBENCH_COLORS_SETTING]: colorCustomizationsSchema
} }
}); };
configurationRegistry.registerConfiguration(themeSettingsConfiguration);
function tokenGroupSettings(description: string) { function tokenGroupSettings(description: string) {
return { return {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册