Crystal-Modeling / tasklist-lang

Langium-based LS for TaskList language implemented in GLSP blueprints. Integrated with GLSP as SourceModel Server for demo purpose
Apache License 2.0
3 stars 1 forks source link

Implement LMS API endpoint for Model validation #37

Open hpopov opened 1 year ago

hpopov commented 1 year ago
  1. I need to Override Langium DefaultDocumentValidator to customize acceptor creation in method validateAst.
  2. 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
    1. So far it is easier to implement this for AstNode-based LMS models, leaving out ArtificialAstNodes (perhaps?). However,
    2. 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
    3. 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