Skip to content

Commit

Permalink
fix: MPS constraints weren't evaluated for wrapper actions
Browse files Browse the repository at this point in the history
  • Loading branch information
slisson committed May 2, 2024
1 parent fea10d3 commit 483596c
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,12 @@ object MPSConstraints : IConstraintsChecker {
// Constraints only prevent creating a node. If it already exists, it's handled by the model checker.
if (node.getNode() != null) return emptyList()

val parentNode = node.getParent()?.getNode().toMPS()
// MPS doesn't support constraint checking without a parent node
if (parentNode == null) return emptyList()
// Correct would be `parentNode = node.getParent()?.getNode().toMPS()`
// but the parent node is not allowed to be null.
// MPS itself then just passes the nearest existing ancestor to the constraints.
// Without this hack we cannot evaluate any constraints and there would be too many incorrect entries in the
// code completion menu.
val parentNode = node.getExistingAncestor().toMPS()

// ConstraintsCanBeFacade.checkCanBeRoot()

Expand Down

0 comments on commit 483596c

Please sign in to comment.