Generic support for commenting out nodes in MPS

MPS now provides a universal way to comment out nodes in models. In previous versions  this functionality had to be implemented in all languages separately, either through node attributes or dedicated “comment” nodes. In 3.3 the information about a node being commented out is stored in the model in a generic way. The smodel language ignores commented out nodes by default so that your queries do not have to filter out commented out nodes explicitly.

Additionally, actions have been created to comment/uncomment out a node.

How to use it

You can select any node in MPS, except roots, and press ctrl/cmd + “/”. That node will be commented out.

Let’s watch some examples.

You can comment out an IfStatement’s condition

a method parameter

a variable type

an editor cell

In fact, every single node can be commented out.

To uncomment the node you simply press ctrl/cmd + “/” on commented node.

How does it work in the model

When one comments out the node, it is placed as a child (wrapped) in a special “child attribute”, called BaseCommentAttribute. Then the instance of this attribute is attached to the commented node’s link in the former parent of the commented node.

The child attribute is the same as the link attribute, but the child attribute is attached to the aggregation link.

So the commented nodes are not stored as the usual children, and they won’t appear in queries like node.children, node.descendants, etc.

But the MPS editor knows about comments and it will draw both children and the commented nodes, in this role.


By default every commented node is drawn surrounded by /* */ . You can define a custom commented editor for the concept.

Just define the usual editor with the hint “comment”.

Note that the children of the commented node should be drawn with their usual editor so you need to remove the comment hint in child cells

Also you can override the comment action in the editor.

For example, we don’t want the %expression% in the ExpressionStatement to be commented out ever.  We want the whole statement to be commented out instead.

So we define the action map for the ExpressionStatement and attach it to the child %expression% cell.

Since can execute block returns false, the COMMENT action will not be executed on %expression% cell. MPS will try to execute the COMMENT action on parent cell, and then the whole statement will be commented out.

Update: A dedicated documentation page is now available in the User Guide. A short video has been published.

Posted in Feature | Leave a comment

MPS 3.3 EAP 2 made available

One month after the first MPS 3.3 EAP release we’re coming with an update. The fresh version MPS 3.3 EAP 2 gives you the chance to taste some more features of the upcoming MPS version:

  • TextGen now allows node attributes to override text generation rules for the attributed nodes. Generator can transparently pass node attributes through the generation process so as they can take effect in a later phase.
  • The way TextGen creates files for root nodes has changed to provide greater flexibility for extending concepts.
  • The mechanism for loading aspects has been unified for all language definition aspects.
  • Generic support for commenting out nodes has been implemented – MPS now provides a universal way to comment out nodes in models. Language designers do not have to implement their own mechanisms, but instead can customize the one provided by MPS.
  • Annotations can be used to override type-system inference rules for expressions/literals.

Descriptions of all the new features are gradually being added to the What’s new in MPS 3.3 page. Check it out for full details.

We hope you’ll experiment with the new possibilities and keep us informed about how you liked them.

Develop with pleasure!
-JetBrains MPS Team


Posted in Announcement | Tagged , , | Leave a comment

MPS 3.2.3 is out

Another bug-fix release in the 3.2 series has been made public – MPS 3.2.3 is now ready for download.

Among the usual doze of fixed issues we’ve also included a single new piece of functionality that was demanded – the ability to invoke arbitrary Java code from the MPS build scripts. The new mps-runner plugin from enables a new build script entry – run code from solution. By pointing it to a solution that holds your Java code the build script will be able to run it as part of the build process.



Develop with pleasure!
-JetBrains MPS Team

Posted in Announcement | Tagged , , | Leave a comment

Starting MPS 3.3 EAP

Today marks the beginning of the MPS 3.3 Early Access Program. We can’t wait to give you a taste of what we’ve been baking here and would love to hear your feedback, while the code is still hot.


From now on we will be regularly sharing the new 3.3 functionality with you, as it gets developed. If you like to experiment with the newest features, now is the best time to get your hands dirty – you can download MPS 3.3 EAP 1,  consult the gradually updated documentation and feel the excitement of living on the edge.

The EAP 1 release contains three prominent features:

  1. custom language aspects – MPS 3.3 will allow language designers to hook in their own language aspects, such as an editor or a type-system. EAP 1 comes with the initial set of changes that enable custom aspects, such as runtime class instantiation in the language descriptor, customisable aspect icons, adjustment of the “new root” menu, and a few others. Integration with smodel as well as an enhanced DSL for describing custom aspects will come next.
  2. overriding the default type – the type-system now has the flexibility to substitute an arbitrary node to represent the type instead of the node originally used as a type. The new Substitute Type Rule applied to original type nodes, returns alternative type representation; the same rule applied to an attribute of the original type node enables aspect-oriented way of altering the default type representation. The Typesystem documentation covers this topic in full detail.
  3. no Used Languages in modules – the need for importing languages twice – both to model, where the language is used, and to the model’s module, is gone. Modules now derive used languages from the models that the module owns. It is no longer possible to add/remove languages in the ‘Used Languages’ tab in module properties.

As with all EAP builds, expect rough edges, unfinished features and bugs. This is part of the joy. Please report all issues to us so as we can fix them and prepare a solid 3.3 release.

More details on these and other planned features are coming soon, so please stay tuned to this blog.

Develop with pleasure!
-JetBrains MPS Team


Posted in Announcement | Tagged , , , | 1 Comment

Releasing MPS 3.2.2

A fresh MPS update is ready for you to download. MPS 3.2.2 comes with a decent collections of fixes and one new variant of MPS distribution. The Mac OS X users can now choose from two options:

  1. the traditional distribution that is compatible with JDK 1.6 and requires this JDK to have been installed on the target system
  2. the new distribution with bundled JDK 1.8

The bundled JDK is a patched version of Open JDK 1.8.0_40 and will be picked by MPS automatically once you start it. To find out under which JDK your MPS is running, open the “About” dialog and check out the splash screen.


The patch in the JDK fixes several UI-related issues that prevented MPS (as well as other IDEs from JetBrains) from running smoothly on JDK 8 under Mac OS.

Develop with pleasure!
-JetBrains MPS Team

Posted in Announcement | Tagged , , | Leave a comment

MPS 3.2.1 is ready

Only shortly after MPS 3.2 has been released, we can’t resist the temptation to share a fresh MPS 3.2.1 update with you. It contains more than four weeks-worth of improvements that could not make it into 3.2.

The MPS plugin is now compatible with both IDEA 14.0 and 14.1. Additionally, we’ve restricted the implicit visibility of the BaseLanguage concepts in language definition languages, since it was causing more harm than good. This may result in a few new “missing dependency on BaseLanguage” errors reported from your existing languages, if you relied on this implicit dependency. You’ll need to add these manually and then all will work just fine again.

You’ll surely appreciate the corrections to several usability issues in the migration assistant, in BaseLanguage as well as in the IDEA plugin. Following your feedback we also have included numerous fixes to refactorings, migrations, debugger and to the editor layout management.

Check out all the 51 YouTrack issues in the release notes and then 3 – 2 – 1 – go get MPS 3.2.1 and enjoy.

Develop with pleasure!
-JetBrains MPS Team

Posted in Announcement | Tagged , , , | Leave a comment

Releasing MPS 3.2

We’re now proudly releasing JetBrains MPS 3.2 – a new version of your favourite DSL language workbench. We’ve built this version to give you a tool that fundamentally improves the way how you evolve your languages – language versioning, migration scripts, simplified VCS conflict resolution, fast in-process tests and a more robust generator – you’ll instantly benefit from these enhancements.
Numerous bug fixes and usability improvements in the editor as well as in the core languages will then make your time spent with MPS more effective and enjoyable.

Here’s a list of the major additions in MPS 3.2:

  • Language versioning enables MPS to keep track of the versions of the languages used in your projects and seamlessly upgrade your code if a newer language version is available
  • New model persistence relies on unique concept identifiers, which gives languages greater flexibility when handling concept names, for example when renaming or deprecating concepts
  • Cross-model generation brings a proper solution to resolving references pointing to declarations in different models during generation
  • Several generation planning improvements make the generation process better organised, more predictable and faster
  • Implementation stripping allows language designers as well as library authors to hide the actual implementation of their packages from their users
  • Resolving changes in the Version-control system for non-conflicting models has been automated
  • With Merge hints language designers may specify custom resolution strategies for properties and links to use when resolving VCS conflicts automatically
  • Test performance has been improved dramatically by enabling in-process runs as well as reusing the test caches

The What’s new page details all new enhancements that MPS 3.2 comes with.

Get your copy of MPS 3.2 today and take the brand new MPS release out for a ride.

Develop with pleasure!
-JetBrains MPS Team

Posted in Announcement | Tagged , , , | Leave a comment

New and updated documentation materials

Now with the 3.2 release of MPS approaching, we’ve updated the introductory materials that aim at introducing newbies to MPS. Typical readers of this blog have probably got over the beginner stage, but many of you may still benefit from some of the materials or use the pointers listed here to help your friends and colleagues to start with MPS smoothly.

Here are the most prominent updates:

  • The Fast Track to MPS tutorial has been updated in many sections so it could be considered the best place to start learning MPS
  • You may have seen the new What JetBrains MPS can do for you? video. If not, check it out!
  • A new series of 11 introductory videos covering all aspects of language definition in MPS has been created
  • A video describing the key principles of the MPS projectional editor has been published
  • The screen-cast Creating your first language in MPS has been updated
  • The mbeddr guys created an updated Why mbeddr uses MPS screencast
  • The User Guide as the ultimate reference documentation has been restructured and updated
  • Two new sample projects come bundled with MPS 3.2:
    • The Migrations sample project to illustrate the workings of language versioning and migration scripts in MPS 3.2
    • The Language Patterns sample project covering basic language design patterns to help beginners properly structure their early languages

We hope you will like what we’ve done.

Develop with pleasure!
-JetBrains MPS Team

Posted in Announcement, Feature | Tagged , , , , , | Leave a comment

MPS 3.2 release candidate 3 is out

Not too long after rc2 we’ve just pushed out an rc3 release of MPS 3.2 and made it available for you to download.

Expect no changes in the functionality, only a few important bug-fixes and performance optimizations, covered by the release notes, have been added.

Develop with pleasure!
-JetBrains MPS Team

Posted in Announcement | Tagged , , , | Leave a comment

Getting closer – MPS 3.2 RC2 released

We’re almost ready for the final release now. A second release candidate has been prepared, tested and put up on the shelf for you to download.

The functionality of rc2 is identical to rc1 and is fully covered by the What’s new document. Release notes list all the bug-fixes that we have addressed since rc1.

Please take the release candidate 2 for a spin and let us know how you liked it and whether it correctly migrated and opened your projects. If all is green, we’re ready to ship very soon.

Develop with pleasure!
-JetBrains MPS Team

Posted in Announcement | Tagged , , , | Leave a comment