Create multiple child nodes when pasting from clipboard

Hi guys,

I am just getting started with MPS and this is my first time posting on this forum so I apologize in advance if I violate any forum rules or conventions.

I am trying to add support to my DSL for creating multiple child nodes when a user pastes a bunch of newline sepertated text.
Namely it would create a new child node for each new line in the text and set the nodes name equal to that lines text.

I've tried using paste handlers, refactoring, substitution menus and a few other things but I haven't quite gotten anything to work.

Namely nothing seems to split the text properly and in the case of the paste handler I can't see a way to get it to alter the nodes in the editor easily.

I was just wondering if this is something that MPS supports, and if there is something stupid that I am missing :)

 

For reference my structure for the root concept looks like this.

concept Schema extends BaseConcept
implements INamedConcept

instance can be root: true
alias: <no alias>
short description: <no short description>

properties:
<< ... >>

children:
fields : TableField[1..n]

references:
<< ... >>

and my child concept's structure looks like this

concept TableField extends BaseConcept
implements INamedConcept

instance can be root: false
alias: <no alias>
short description: <no short description>

properties:
<< ... >>

children:
<< ... >>

references:
<< ... >>

thanks and kind regards,

Ryan Weyers

Please sign in to leave a comment.