Assignment action

Hey forum!

I have a custom assignment named Instruction. Instruction has a left and a right child. I want to create the right child and focus the right node when the operator "=" is typed. So my editor should look like this:

%left% = %right%

Then I created an edit an side transform action for instruction. Then I added a custom item with matching text "=". But unfortunately, the editor doesn't focus %right% when "=" is typed.

What's wrong here? Thanks!



Comment actions Permalink

Is the side transform action called?

If not , you might have to add a constraint, so that "=" can't be part of the name of the left left child. Because as long as "=" can be part of a name the editor is just going to add "=" to the name instead of calling the sidetransformation.

Look under Constraint -> property Constraint  of the concept of the left child.

Comment actions Permalink

If the side-transform gets triggered and the problem is in the focus only, then you probably need to explicitly set the desired cell to focus. After importing the jetbrains.mps.lang.editor language, add something like this to your handler:[in: editorContext, cell: LAST_EDITABLE];



Comment actions Permalink

Thanks guys! The editor context did the trick!


Please sign in to leave a comment.