Open new tab with concept in intention

Hi MPS Team,

just a simple question i did not found in the userguid..

I have a concept "Command" which is defined as root concept. I added an Intention "CreateCommand" to my other concepts, in order to create commands on the fly by ALT-Enter.

It would be very nice, if i can open the command in a tab, after creating it.. how can i achieve that? I guess editorContext is the solution, but i did not find an apropriate method.   


editorContext.selectNode(myCommand) did not do the job...

Best,
Dan
6 comments
MPSEditorOpener.editNode()

Regards,
Mihail
0
Mh.  i use mps 2.0.6 ... i do not have a static method editNode ...
0
Hmm... 2.0. )

Suppose it's done like
new MPSEditorOpener(project).editNode(...)
prettyPrint(); or
operationContext.getComponent(MPSEditorOpener.class).editNode(...)
prettyPrint(); Please see how it's done in your version of MPS in EditNode/CreateRootNode actions.

Regards,
Mihail
0
Hi Mihail,

thanks for your answers - long time ago we met in cambridge :)

i have not project, nor a operationContext in "intentions" .. only editor and node itself ...

Dan
0
I do remember you, Austrian colleague ;)

There's no problem - editorContext.getOperationContext().getProject() - you can get both.
0
Actually, IOperationContext was an analogue of Pair<Project, Module> in 2.0. It was used to determine "where" we are since we were not able to obtain this info from a node - its model could have many owning modules, and each of those modules could be used in multiple projects.
Since 2.5 it's an analogue of MPS Project since a model can have only one module.
I think, by 3.5 or 4.0 we'll have per-project repositories and we'll get rid of operation context.

Just FYI
0

Please sign in to leave a comment.