Type Alias ValidationPreparation

ValidationPreparation: ((rootNode: AstNode, accept: ValidationAcceptor, categories: ValidationCategory[], cancelToken: CancellationToken) => MaybePromise<void>)

A utility type for describing functions which will be called once before or after all the AstNodes of an AST/Langium document are validated.

The AST is represented by its root AstNode.

The given validation acceptor helps to report some early or lately detected issues.

The 'categories' indicate, which validation categories are executed for all the AstNodes. This helps to tailor the preparations/tear-down logic to the actually executed checks on the nodes.

It is recommended to support interrupts during long-running logic with 'interruptAndCheck(cancelToken)'.