What’s New in MPS 2021.2

MPS 2021.2 brings spell-checking mechanism, automatic completion pop-up, VCS enhancements, and much more.

Automatic completion pop-up

Code completion, which is normally invoked by pressing Ctrl/Cmd + Space, now pops up automatically after you stop typing, with a half-second delay by default. It can still be opened manually if needed. Learn more.

Improvements to wrapping and unwrapping changes in the VCS diff

Improvements to wrapping and unwrapping changes in the VCS diff

Wrapping changes are now much more flexible. It is possible to have independent internal changes inside wrapping and unwrapping changes. In addition, it is possible to have several wrapping and unwrapping changes next to each other. The internal moves are now detected inside nodes with changed IDs.

Improved display of node attribute changes

Improved display of node attribute changes

Editor cells for attributes were previously not being correctly highlighted in the Diff dialog. Typically, the whole node with the attribute was highlighted if an attribute was added or deleted, rather than just the attribute in question.

Generic spell-checking mechanism

Generic spell-checking mechanism

MPS functionality that employs an IntelliJ IDEA spell-checking mechanism to check comments and string literals for typos and mistakes has been extended to work with any text that may show up in a label cell. To indicate that the text of a cell has to be checked against a dictionary (as configured in Preferences), you just need to add the spellcheck style to the cell in your editor declaration.

For Rich Client Platforms (RCP), don’t forget to include the jetbrains.mps.editor.spellcheck plugin in the distribution.

Project version for migrations

Project version for migrations

We’ve addressed the scenario where a project that has been migrated to a newer MPS version is accessed by a developer with an older MPS version. The Migration subsystem now tracks the MPS platform version when applying migrations, and it warns you if a project you try to open has been migrated to a newer version. This helps prevent the unintended corruption of models.

Optimized reference scope

There’s a mechanism for sharing evaluated scope pieces during a single model read. New expressions in j.m.lang.constraints for sharing scopes were introduced: for model [ factory, key], visible roots [concept], and visible nodes [concept] as replacement for new ModelPlusImportedScope(model, rootsOnly, concept). The new expressions are used to save the scope of a model to cache memory, meaning that it only needs to be recorded and calculated once.

No limitations when modifying nodes

Extension authors have to select what type of access to grant when they write code that works with MPS models. For SNode operations (e.g. setProperty(), addChild(), etc.), it was only possible to grant command access, even without UI interaction. This limitation has now been lifted, and any code that holds write access for the model can now modify nodes.

Tooltip radar

Tooltip radar

The Tooltips feature now has a functionality called radar that shows which cells have tooltips. The Tooltip radar can be activated by pressing and holding the Ctrl key.

Diamond operator

It is now possible in baseLanguage to use the Java diamond operator on constructors to infer generic parameters from context. The diamond operator will be enabled by default for newly written code. To enable it on your existing constructors, remove your existing type parameters and set infer type parameters to true in the inspector, or type <> again and remove the empty parameter.

BaseLanguage properties improvement

Properties in baseLanguage are now taken into account correctly on type checking. No errors for an unimplemented method will be raised when a property inherits interface or abstract methods. When defining a property with a generic type, the correct type is used for accessing the property on an instance.

Note that the setter exposed for a property of type T will return an object of type T, rather than void.

Unified Show Diff

Unified Show Diff

MPS now displays the difference between the initial and changed versions of files in the editor tab. It doesn’t matter how you invoke the Show Diff action, the IDE will open the diff in the editor by default.

If you find it more convenient to track changes in a separate window, you can drag the desired file from the editor. If you do, the IDE will remember this and will open future diffs in a separate window.

Other improvements

New navigation option in Preferences/Settings

New navigation option in Preferences/Settings

New arrows are located in the top right-hand corner of the window in Preferences/Settings to help you navigate through the sections. They allow you to jump back and forth between the sections.

Drag and drop tool windows

It is now easier to drag and drop a tool window to move it within the main IDE window or to make it a separate window. You can drag a tool window by clicking and holding its name bar and dropping it in any highlighted place.

Built-in HTML preview

Terminal enhancements

There are new options for the cursor shape in the built-in terminal. Furthermore, the terminal also offers new support for shortcuts using Option (⌥) as a Meta key. For example, you can use the following shortcuts:

  • ⌥+F – go to the next word
  • ⌥+B – go back a word
  • ⌥+D – delete the next word