JetBrains / MPS-extensions

MPS-extensions aims to ease language development within MPS.
https://jetbrains.github.io/MPS-extensions/
Apache License 2.0
83 stars 51 forks source link

Grammar cells: WrapperCell should take concept's constraints automatically into account #641

Closed alexanderpann closed 9 months ago

alexanderpann commented 1 year ago

Example: concept Argument with child type and editor wrap % type % and a constraint can be parent that restricts the type. The type can be substituted despite the constraint. The node substitution condition of the wrapper cell has to duplicate the logic of the constraint. I am not sure if it is worth implementing.

slisson commented 1 year ago

Some costraints can only be evaluated after a node is created. "can be parent" needs the parent node which doesn't exist yet. Maybe we can do some hack and provide a custom SNode implementation for the non-existing node.

HeikoBecker commented 1 year ago

In a videocall with @alexanderpann, we concluded that the exact problem lies in the can be ancestor constraint:

If a concept constrains a chilld using the can be ancestor constraint, restricting the concept(!) of children, plain MPS will use the concept to filter the available children in the auto-complete menu, but when grammar cells is uised, this is not the case.