Use schema allOf property to get independent error reporting

fixes #21113
This commit is contained in:
isidor 2017-02-23 11:15:32 +01:00
parent 7239bb2c33
commit 973bac0c4f

View file

@ -226,8 +226,14 @@ export class Adapter {
properties: osProperties
};
Object.keys(attributes.properties).forEach(name => {
attributes.properties[name].errorMessage = attributes.properties[name].errorMessage || nls.localize('deprecatedVariables', "'env.', 'config.' and 'command.' are deprecated, use 'env:', 'config:' and 'command:' instead.");
attributes.properties[name].pattern = attributes.properties[name].pattern || '^(?!\\$\\{(env|config|command)\\.)';
// Use schema allOf property to get independent error reporting #21113
const allOf = [attributes.properties[name], {
errorMessage: nls.localize('deprecatedVariables', "'env.', 'config.' and 'command.' are deprecated, use 'env:', 'config:' and 'command:' instead."),
pattern: '^(?!\\$\\{(env|config|command)\\.)'
}];
attributes.properties[name] = {
allOf
};
});
return attributes;