Trouble with the side transform action

Hello.

I'm trying to reproduce something like VariableDeclaration and its Initializer, that appears when I press the '=' button.

I have one rootable concept Parameter, that implements INamedConcept and has a string property 'value'. Its editor looks like this:
editor for concept Parameter          
  node cell layout:    
    [> {name} ?[> = {value} <] <]
prettyPrint();
where '=' is a constant cell and the show condition for inner group is
node.value.isNotEmpty
prettyPrint();
Also it has TransformMenuItem like this:
side transform actions AddInitializer
  right transformed node: Parameter tag: default_ //<no description>
    condition :
      (operationContext, scope, model, sourceNode)->boolean {
        sourceNode.value.isEmpty;
      }
          
    common initializer :
      <no common variables>
      ....................................
      <no common initializer>

    actions :
      add custom items  (output concept: Parameter)
        simple item
          matching text
            =
          description text
            <default>
          icon
            <default>
          type
            <default>
          do transform
            (operationContext, scope, model, sourceNode, pattern)->node<> {
              sourceNode.value.set("zero"); 
              return sourceNode; 
            }
prettyPrint();

Than I create a new Parameter in the solution, specify some name like 'Param' and press the '=' button. I expect to see something like this:
Param = zero
prettyPrint();
but nothing happens, the '=' char just added to the parameter name.
What I'm missing?

Thanks,
Alexey
2 comments
The solution was to add a property constraint, that does not allow the '=' char in the name. Unfortunately it's not intuitive enough:(
1
Yep, that is the best solution here.  

MPS doesn't restrict the label content by default. All positions in your editor belong to the label, so there is no way to "exit" from the label. Adding any punctuation can help. Almost always when you have a property without quotes, brackets or other delimiters around it you should somehow constraint its content to get rid of the possible ambiguity in the language.
1

Please sign in to leave a comment.