Comment out some Code

Hi,

is there a possibility to comment out some line of code in Behaviour/Constraint/Class etc.? It seems that i may only create a *new* remark and write my comment after that.

Thanks,

Mirko

0
4 comments

Mirko,

Now you can only comment/uncomment a part of a StatementList (e.g. you can comment sequential statements inside one method, but can't comment MethodDeclaration itself). Try using ctrl+shift+/ when several statements are selected.

This is an ability of baseLanguage, so you can use it everywhere in statement lists.

Regards,

Mihail

0

Hey, very cool... I'd been wondering if this was possible!  Thanks, Mihail! :-)  That is a handy trick.

0

Are you aware about ctrl-alt-T (“surround with”) keyboard shortcut? If you select one or several adjacent statements and hit ctrl-alt-T, MPS will offer you a few “surround with” choices – block comment among them (nicknamed as /**/).
The ctrl-alt-T is kind of our standard for the “surround with” through all languages in MPS as well as in Intellij IDEA.
BTW, if you are planning to add “surround with” to your implementation of MPS C# language, then it would be nice if you use the same shortcut.
For reference, see Statement_KeyMap node in baseLanguage’s editor model.
Best – Igor.

0

Hi Mihail and Igor,

thx for those hints! Both work fine.

MIrko

0

Please sign in to leave a comment.