Surround with Region feature in MPS

Hello forum!

 

I want to build a feature called "Surround with Region". It's available in Visual Studio. Have a look here

http://i.stack.imgur.com/8wdh8.png

Recently I've seen this feature with MPS intentions

https://confluence.jetbrains.com/display/MPSD25/Intentions

Then I want to port the region feature from Visual Studio to my MPS DSL.

I had a look on the sample Kaja. There is an intention called Extract Routine defined. But you can only mark one DSL argument and not multiple.

Have a look at the underlying image.

 

Can someone tell me how to achieve that?

 

Best regards

m sch

10 comments

Hello,

 

this is a known issue - multiple nodes cannot be surrounded-with an intention (https://youtrack.jetbrains.com/issue/MPS-20839).

 

Vaclav

 

1

Does "Selection Intentions (com.mbeddr.mpsutil.selection.intentions)" cover what you want?

0

Hello Vladimir!

Thanks for your answer. That could very well fit my needs. Unfortunately, I can't open the link in MPS. Looks like having an MPS 3.2 and old mbeddr version isn't compatible.

0

>I can't open the link in MPS

Which link do you mean?

>MPS 3.2 and old mbeddr version isn't compatible

Can you upgrade to MPS 3.3.x? Current mbeddr is using MPS 3.3.1

0

Sry I forgot to include it (mentioned on the mbeddr platform page)

http://localhost:8080/select/com.mbeddr.cc/r:a85ddf64-0248-4e9b-81ab-306845f3da69/1802085703486799709/

Yep, I do so.

0

Here's what I the link opens for me.

It does very well look an "intention for selected nodes"

2

I'll keep that in mind and will try it out, if I have time to update my MPS installation..

0

I am writing a few SelectionIntentions right now. Maybe these hints will help someone.

The package "com.mbeddr.mpsutil.selection.intentions" doesnt exist anymore, or I cant find it. But there are the packages

 



which, for me, provided the possibilty to use intentions on a range of nodes, like in the example above.

 

Second thing is, that there is a kinda of funny behaviour with these SelectionIntentions. If the Intention-Aspect in your language only has a SelectionIntention in it, it does not compile, at least not for me. Adding a "normal" Intention of any kind ( I just added a intention which does nothing and is never applicable) makes the build process work.

 

Third and last, I am using an annotation on some nodes. I have an Editor defined for that annotation, which display the annotated node, and some other information. The process of selecting those annotated nodes did not work. I had to change some code in

Hope it helps someone save some time.

 

1

Hi Vladimir and Jochen,

@Vladimir - you referred to mbeddr in a post of mine; thanks for that. I looked at it, but had the same problem as the user above, I cannot open the link. The error is:
I copied the plugins from mbeddr to my MPS plugins folder, and I can see the solution de.items.mps.selection.runtime and the language de.itemis.mps.selection.intentions. I added those to the project and rebuild my project. However, I can't seem to be able to create an intention for the selection -- I cannot change "for concept" to "for selection" -- as shown in your picture.

Any hints?

0

Hello
I think you are trying to change something that cant be changed.
The way to use these new intentions is to add the language "de.items.mps.selection.intentions" to the Intention aspect of your language.
Then you can select "new" - > "sourrond-with intention " on your intention aspect. From there you can use the example code vladimir showed a few comments above. Hope that helps.

0

Please sign in to leave a comment.