Making constants selectable via TAB

Hi,

This problem is similar to the post here: https://mps-support.jetbrains.com/hc/en-us/community/posts/206870329-Moving-cursor-past-a-collection-in-the-editor?input_string=Making%20constants%20selectable%20via%20TAB

I have a concept that has a horizontal collection after the collection I have optional properties that I have transformations to make them appear or disappear. However because items in my collection are referenced by name I can not move past the collection to trigger the transformation.

I made a constant element after the collection but I cannot tab to the constant element even if I set selectable to true. If I make the constant cell editable, I can tab to it but then the transformation does not trigger. It edits the constant cell instead.

Is there any way to create a space after the collection that can trigger a transformation?

Example:

Mix fluidA with fluidB
                                ^ collection end

Mix fluidA with fluidB at 96°C for 10min
                                      ^            ^         optional properties

Thanks,

Chris

 

2 comments

You are on the right track. This is what you need to set in the Inspector for your empty constant cell in order to get the desired behavior:

Style:
<no base style> {
  editable : true
  selectable : true
}

Common:
  cell id <default>
  action map <default>
  keymap <default>
  menu menu parts:
    apply side transforms
      side: right
      tag: none
  attracts focus noAttraction
  show if (editorContext, node)->boolean {
    <optional properties not shown> 
  }

Setting the "menu" is key here, in my opinion.

Vaclav

 

1

Please sign in to leave a comment.