What's New in MPS 2018.1

SModel language enhancements

In some cases, you have to deal with raw pointers (like SNodeReference or SModelReference). Working with them can be puzzling since it's hard to create and operate them. To make working with pointers easier we bring new types and operations in SModel language.

Node pointer

We have made working with node pointers easier, by introducing a new "node-ptr<>" type. These pointers can be resolved to the actual nodes via the "resolve" operation. The "node-ptr/ ... /" expression is a replacement for the old "nodePointer/ ... /" construct, which is already deprecated. Migration scripts are created to take care of the conversion of the expressions.

Setting references with pointers

When setting a target to a reference link, there is no need to access the target node. A pointer to the target is enough. The "set ptr" operation applicable to reference link access expressions sets the reference target to the specified pointers. To check that a node is the one specified by a node pointer, the new "is" operation should be used.

Strict typing rules for smodel types

The typing rules for SModel types have been made stricter. The SNodeReference interface methods are no longer available on “node-ptr" values. The downcast operator should be used to explicitly obtain SNodeReference. Additionally, the "pointer" operation on node instances now returns "node-ptr" instead of the regular SNodeReference.

Node-ptr expressions in reference macro

The reference macro was modified to accept node-ptr expressions. We verify the pointer type returned from the reference macro in accordance with the type of the reference.

Node Id to specify pointer

Now you can use the model name and node ID to specify a pointer to a non-named concept instance or for hard coding a reference as a string.

Model pointers

The "model-reference" type has been refactored into "model-ptr<>". This pointer can be resolved to the actual model via the "resolve" operation.

New Migration scripts

We have introduced a couple of migration scripts that may help you migrate old SModel Language constructs like the node/.../` expressions, undesirable quotations or downcasts. To run them, go to Tools -> Scripts -> Enhancements... and choose "SModel Language Enhancements (node-ptr<> and model-ptr)". Also, in the same window, there is the "Use node pointers in reference macro queries" option available that handles old constructions in the generator macros.

Improved scoping for SModel queries

Smodel queries now behave more intuitively towards the scope they operate on. If a scope is declared as a parameter to a specific query, the query is executed on the whole scope including any read-only models, not only from editable models, like it was before.


Show reflective editor for the subtree

Now you can show the reflective editor for a whole subtree. To do so, select the node and press Cmd/Ctrl+Shift+[ or choose “Show reflective editor for subtree” from the context menu. For going back to the regular editor, press Cmd/Ctrl+], Cmd/Ctrl+Shift+] or right-click the option “Show regular editor for the Subtree”. Showing the reflective editor for just the current node is still available by pressing Cmd/Ctrl+[ or from the context menu.

Transformation menu for property and reference cells

The transformation menu language has been consistently enhanced to support property and reference cells. Property and reference transformation menu parts allow you to customize the menus for property and reference cells better than the “inline menus” used previously.

The two key advantages are:

  • They can be attached to any cell; not just property and reference cells.
  • They can be applied to the completion as well as to the other locations – context assistant, context menu, and side-transformations.
Learn about MPS 2017.3

What's New in MPS 2017.3


Generic placeholders

We've introduced the notion of a generic placeholder. A generic placeholder may be used as an empty position marker in any child collection in any language, and it may optionally hold additional content. By default, this placeholder node is represented in the editor as an empty space and behaves in a transparent way – you can invoke the completion menu on the placeholder node to replace it with a valid child node, or you can press Enter to add a node in the next sibling position. The Control/Cmd + Shift + Enter key combination inserts the placeholder at the current position within a collection.

Free-floating comments

A generic DSL commenting functionality has been implemented using the new generic placeholder. To take advantage of this, simply import the jetbrains.mps.lang.text language or the general-purpose devkit. This will give you a fully editable multi-line text language with support for basic styling (bold, italic and underlined), clickable hyperlinks, and embedded nodes (code). Just type "[" when positioned on a generic placeholder to start typing your comment. In addition to this default commenting language, you can create a custom one to meet your specific needs.

Customize font family for cell

A new editor style font family in the editor definition is now available to enable customization of a font alongside its size and style properties. Use the fontFamily expression to reference any of the installed font families.

Select All

A new action, SELECT_ALL, is now available to select the entire content across the whole editor. You can trigger it with the Control/Cmd + A shortcut, and customize its behavior for your own concepts by using action maps.

Undo for deleted nodes

We've improved how undo works for deleted nodes. After undoing a root node deletion, you can still undo any previous modifications performed inside that root prior to its deletion.


Linking checkpoint models

Checkpoints now allow resolving references in mapping labels across multiple generator phases. You can thus safely resolve references to nodes even if they were generated at an earlier checkpoint.

Avoiding unnecessary file overwrites

The make process does not overwrite generated files that hold identical content to the one just generated. You can now rely on the fact that only the modified files get updated on disk.

Build Language

A new way to copy module resources

The 'resources' content root specified on modules now serves the purpose of copying resources into a deployed module. A migration has been provided to incorporate the file masks previously hardcoded in resource-copying templates.

Ant Tasks

The MPS ant task provides full control over the repository contents with several new tags – module, modules and allmpsmodules.

Migration Ant task improvements

The Migration Ant task is now more user-friendly.

  • Problems during migration make the ant script fail and are properly reported to the user.
  • We support all legacy attributes for specifying mps location – mps.home, mps_home environment properties, and the mpshome task attribute. The preferred way is to use the mps.home environment property.

DevKit packaging improved

Devkit modules are no longer deployed as files, but instead are bundled into jar files just like other modules. A migration script has been provided to automatically update the devkit layout elements in your build projects with the new 'module' layout element.

Other Improvements

NodePointer for child elements

The nodePointer expression from lang.smodel can optionally reference not only roots, but also any named elements now.

Make considers model dependencies

Make of a model also makes all the model dependencies that need to be regenerated. This saves time and helps avoid surprises.

Model clone improvement

The Model Clone action correctly updates cross-root references for elements of the cloned model. The cloned model is now completely independent of the original model.

Download MPS

Learn about MPS 2017.2

What's New in MPS 2017.2


Cross-model generation enhancements

Generation plans can generate descriptor models for languages. The Structure, TextGen, Typesystem, Dataflow and Constraints aspects are generated with generation plans and they use the new cross-model reference resolution mechanism. Custom aspects defined by language authors can participate in this mechanism, as well.

Reference macros returning SNodeReferences

Targets for references set through reference macros (->$) can be additionally specified as SNodeReferences. Using SNodeReferences avoids the necessity to access the target node's model when the macros are being applied.


Reference actions

Reference actions are newly supported by the Substitute Menu Language. They specify how the completion menu is filled with potential target nodes of a reference and also to customize their visual appearance.

Custom reference presentation and matching

To make things more consistent, the Editor aspect instead of the Constraints should now be used to specify the visual presentation of a reference. Additionally, the reference cell menu provides means to specify the matching text. We've also prepared a migration to move the definitions from Constraints into the Editor aspect automatically for you.

Menu Item Trace

Editor implementers will love this one - to track, which transformation or substitute menu contributed a particular action to the completion menu or to the context assistant, they just press Control/Cmd + Alt + B on a completion menu entry and an interactive trace report will show up, detailing the path through the menus to the selected menu entry.


Shiftless code completion

The code completion got yet smarter - you no longer need to press shift to capitalize characters in multi-word names. MPS will figure out suitable matches for you.

Two step deletion

Deletion has become safer. In order to avoid surprises when the user presses Delete or BackSpace, the projectional editor now provides visual feedback about what is going to be deleted. The part of the code, which is about to be deleted, becomes highlighted first. Only when the user presses Delete or Backspace again, the code will be deleted.

Not editable R/O model access cell

The Read-Only model access cells are rarely used for changing values, so we reconsidered the defaults and made these cells non-editable (editable == false) by-default. It is still possible to manually set the editable property to true to make the cell editable, may you need so.


Migration assistant redesigned

The migration assistant has been rewritten from scratch to offer a better view of the recommended migrations and also to give the user the ability to deliberately skip over non-critical migration errors.

Migration assistant in IntelliJ IDEA

The IntelliJ IDEA plugin can now run language migrations. Just like in MPS, the Migration assistant will update models in IDEA projects to match the currently installed versions of used languages.

Other improvements

Annotation for smart references

MPS has always been automatically detecting smart references to provide suitable textual presentation and code completion for them. The @smart reference annotation can be used on concepts that do not meet the criteria for implicit detection of smart references, for example because they customize their presentation or hold additional references.

Public API for Intentions

The Intentions language aspect now provides a new API in the jetbrains.mps.openapi.intentions.* package. The old jetbrains.mps.intentions.* package has been deprecated and will be removed in the next MPS release.

Running editor tests in IDEA Plugin

With the new JUnit test suite (jetbrains.mps.idea.core.tests.PluginsTestSuite) it is possible to execute editor tests inside the MPS plugin for IntelliJ IDEA.