I need to Override Langium DefaultDocumentValidator to customize acceptor creation in method validateAst.
LMS-aware acceptor should not just accumulate Diagnostic (and later attach it to LangiumDocument), but also add validation info (including messages and, most importantly, AstNodes) to Semantic Domain provided that consumed AstNode is semantically Valid
So far it is easier to implement this for AstNode-based LMS models, leaving out ArtificialAstNodes (perhaps?). However,
You should impove creation of Artificial AstNodes by:
Removing name from the Transition -- it is relevant for TransitionIdentity only, it is not used in Transition LMS Model! It will pose some difference in Reconciler (which is OK), but at the same time, Valid Transitions (ArtificialAstNodes) will be available at the same time as Valid Tasks
acceptor can check, if the Valid node is present (or, is the node Valid?), so that validation checks, which do semantic validation only (invalid nodes are not part of LMS model), are ignored
DefaultDocumentValidator
to customizeacceptor
creation in methodvalidateAst
.acceptor
should not just accumulateDiagnostic
(and later attach it toLangiumDocument
), but also add validation info (including messages and, most importantly, AstNodes) toSemantic Domain
provided that consumedAstNode
is semantically Validname
from theTransition
-- it is relevant forTransitionIdentity
only, it is not used in Transition LMS Model! It will pose some difference in Reconciler (which is OK), but at the same time, Valid Transitions (ArtificialAstNodes) will be available at the same time as Valid Tasksacceptor
can check, if the Valid node is present (or, is the node Valid?), so that validation checks, which do semantic validation only (invalid nodes are not part of LMS model), are ignored