Protected
addOptional
categories: ValidationCategory[]Protected
handleRegister a set of validation checks. Each value in the record can be either a single validation check (i.e. a function) or an array of validation checks.
Set of validation checks to register.
Optional object to be used as this
when calling the validation check functions.
Optional category for the validation checks (defaults to 'fast'
).
Register logic which will be executed once after validating all the nodes of an AST/Langium document. This helps to finally evaluate information which are collected during the checks on the AstNodes.
As an example, for validating unique fully-qualified names of nodes in the AST, here the map with all the collected nodes and their names is checked and validation hints are created for all nodes with the same name.
Note that this approach makes validations stateful, which is relevant e.g. when cancelling the validation. Therefore it is recommended to clear stored information before validating an AST to validate each AST unaffected from other ASTs AND after validating the AST to free memory by information which are no longer used.
Optional object to be used as this
when calling the validation check functions.
Register logic which will be executed once before validating all the nodes of an AST/Langium document. This helps to prepare or initialize some information which are required or reusable for the following checks on the AstNodes.
As an example, for validating unique fully-qualified names of nodes in the AST, here the map for mapping names to nodes could be established. During the usual checks on the nodes, they are put into this map with their name.
Note that this approach makes validations stateful, which is relevant e.g. when cancelling the validation. Therefore it is recommended to clear stored information before validating an AST to validate each AST unaffected from other ASTs AND after validating the AST to free memory by information which are no longer used.
a set-up function which will be called once before actually validating an AST
Optional object to be used as this
when calling the validation check functions.
Protected
wrapProtected
wrap
Manages a set of
ValidationCheck
s to be applied when documents are validated.