提交 69dfecdb 编写于 作者: M Martin Aeschlimann

Allow custom error messages for regex issues

上级 5168697d
......@@ -39,6 +39,8 @@ export interface IJSONSchema {
not?:IJSONSchema;
enum?:any[];
format?: string;
errorMessage?:string; // VS code internal
}
export interface IJSONSchemaMap {
......
......@@ -452,7 +452,7 @@ export class StringASTNode extends ASTNode {
if (!regex.test(this.value)) {
validationResult.warnings.push({
location: { start: this.start, end: this.end },
message: nls.localize('patternWarning', 'String does not match the pattern of "{0}"', schema.pattern)
message: schema.errorMessage || nls.localize('patternWarning', 'String does not match the pattern of "{0}"', schema.pattern)
});
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册