eclipse-langium / langium

Next-gen language engineering / DSL framework
https://langium.org/
MIT License
725 stars 65 forks source link

Enable array of validations for AstNodes #1299

Closed JohannesMeierSE closed 10 months ago

JohannesMeierSE commented 10 months ago

At the moment, it is possible to register a single function for checking AstNode like this:

const checks: ValidationChecks<MyAstType> = {
  // ... checks for language-dependent types ...
  AstNode: checkAstNode
};

But it is not possible to register an array of functions for checking AstNode. This PR enables this feature:

const checks: ValidationChecks<MyAstType> = {
  // ... checks for language-dependent types ...
  AstNode: [ checkAstNodeOne, checkAstNodeTwo ]
};

This behaviour is already supported for language-dependent types, but not for AstNode yet.