Allow custom error messages for regex issues
This commit is contained in:
parent
5168697dfd
commit
69dfecdbe4
|
@ -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)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue