This commit is contained in:
Sandeep Somavarapu 2020-11-03 14:40:05 +01:00
parent 7936093c33
commit f5490aed3d
2 changed files with 7 additions and 0 deletions

View file

@ -478,6 +478,9 @@ const configurationRegistry = new ConfigurationRegistry();
Registry.add(Extensions.Configuration, configurationRegistry);
export function validateProperty(property: string): string | null {
if (!property.trim()) {
return nls.localize('config.property.empty', "Cannot register an empty property");
}
if (OVERRIDE_PROPERTY_PATTERN.test(property)) {
return nls.localize('config.property.languageDefault', "Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.", property);
}

View file

@ -28,6 +28,10 @@ const configurationEntrySchema: IJSONSchema = {
properties: {
description: nls.localize('vscode.extension.contributes.configuration.properties', 'Description of the configuration properties.'),
type: 'object',
propertyNames: {
pattern: '\\S+',
patternErrorMessage: nls.localize('vscode.extension.contributes.configuration.property.empty', 'Property should not be empty.'),
},
additionalProperties: {
anyOf: [
{ $ref: 'http://json-schema.org/draft-07/schema#' },