What’s New in MPS 2021.1

MPS 2021.1 introduces support for Java Annotation, lots of VCS improvements, Apple Silicon, and much more.

Editor

Zoom in and zoom out

The font size can be quickly adjusted in an open editor window by holding Control and rolling the mouse wheel. Font size changes are not persistent, so when you reopen the file, the text size will be reset to the default value. You can enable/disable this feature in Preferences | Editor | General section: Change font size with Ctrl/Cmd+Mouse Wheel.

Improved performance on indent layout

The implementation of the indent layout has been made incremental in some core cases, which will reduce the rendering time for big models in languages that mainly use the indent layout (such as BaseLanguage). This feature can be disabled with the VM option mps.indent_layout.disable_incremental.

Font weight options

Font weight options

Choosing an editor font that you can look at without difficulty for long stretches of time is crucial. The recently added typography settings make this choice a bit easier and more personalized. In v2021.1, you can fine-tune the weight of your main and bold font styles in Preferences | Editor | Fonts.

Version Control System

Root annotation improvements

Root annotation improvements

Version Control System support adds improvements to the root annotation. A new algorithm for calculating revision changes with movement tracking is now used for root annotation. The colors for annotated lines/cells are determined using only those revisions where the root was changed. The annotated cells now have the special context menu group when the annotation column is open. You can apply Copy Revision Number, Show Diff, and other actions to each annotated cell.

Diff dialog for merge commits

Diff dialog for merge commits

The diff dialog is enabled for merged commits in the Git log. The viewer displays three panels – the center panel for the merged model, and the left and right panels for the models of the two merged branches.

Synchronize scrolling in the Diff editor

Synchronize scrolling in the Diff editor

It is now possible to switch off the editor scrolling synchronization in the Diff dialog with a button.

Revisions graph used for root annotation and root/node history

The root annotation and root/node history algorithms were previously based on the ordered list of file revisions, calculating the changes for the root between two adjacent revisions. It was possible, however, for these revisions to be from two different branches, in which case the obtained changes made no sense. Merge revisions also were not handled correctly. The changes from the older rounds of revision could be erroneously displayed as changes from the newer merge revision. Now the algorithm considers the revisions graph when it formulates the change history.

Save to Shelf

Our new Save to Shelf action allows you to copy your changes to the Shelf while keeping them in the local changes. You can access this action by pressing ⇧⌘A on macOS (Ctrl+Shift+A on Windows or Linux) and typing ‘Save to Shelf’.

Generator

Improved access to $LOOP$ macro variables

Improved access to $LOOP$ macro variables

It is now possible to refer to the input node of a LOOP macro by using a LOOP.inputNode expression, removing the need to use a VAR macro. The index of the LOOP can also be accessed under the same namespace by using LOOP.index and replacing the previous user-defined context variable.

Updated Transform statement in GenPlan declaration

To improve Generation Plan extensibility, there's a new mechanism for including languages or generators that are unknown to the plan designer. Now, with the transform statement, the language designer may include a language that targets or extends a given one. When we say Language B 'targets' Language A, we mean that Language B's generator produces constructs of Language A.

Compiled templates enhancement

With MPS 2021.1, compiled templates now check whether children are properly placed into parent nodes if the option is active.

Learn more

Miscellaneous

Java Compiler for MPS modules with Java facet

A lot has changed in our approach to Java compilation of MPS modules. This addresses one of our top-voted issues, Annotation Processing support. We switched the MPS Java Compiler infrastructure to utilize the javax.tools.JavaCompiler set of APIs, so MPS can now use any compiler that implements this standard API. As of version 2021.1, MPS runs with the default compiler configured for this API, with an option to use the Eclipse Compiler for Java (ECJ).

Learn more

Baseline MPS version for project migrations

When a new project is created, a ‘baseline’ MPS version will now be saved. Project migrations from MPS versions earlier than the project’s baseline version won’t apply. This gives authors the flexibility to give project migrations a specified desired ‘baseline’ version, which they can modify in the Project migration interface by using the new ‘getBaselineVersion():int’ method.

Learn more

Method signature refactoring improvements

Method signature refactoring improvements

The Method Signature refactoring dialog now includes a way to specify default values for new arguments or arguments whose types have changed. When a parameter is removed but is still used in the method, a new local variable is introduced so the reference is not lost. If the call of a method does not match its signature, an intention action allows you to change the method’s signature to bring it in line with the call.

Learn more

New options in BaseLanguage comments

The lang.text language has been given several new capabilities, which directly enhances single and multi-line comments in BaseLanguage.

  • Text selection now allows you to highlight only parts of lines when selecting up and down.
  • Actions such as bold, italicize, and underline work on selection.
  • Copy/paste from and into plain text has been implemented.
  • Bulleted and numbered lists are now supported.

Improved expressions in lang.smodel

The expressions model.roots(), model.rootsIncludingImported() and model.nodesIncludingImported() now support #expression for specifying concepts, just as model.nodes() does.

Control visibility of modules distributed with your plugin

Plugins tell MPS about modules they contribute to by means of a com.intellij.mps.LanguageLibrary extension point. Extension points may now provide an optional hide="true" attribute, which makes modules of the plugin eligible to be filtered by a pattern specified with com.intellij.mps.VisibleModuleMask.

Learn more

Other improvements

Built-in HTML preview

Built-in HTML preview

The new built-in browser preview allows you to preview HTML files quickly. To open it, click on the icon with the MPS logo in the widget in the top-right corner of the editor. If you make any changes in HTML or if you change the linked CSS and JavaScript files, the preview will update on the fly.

Apple Silicon Support

You can now use MPS on Macs that have an M1 chip. To get started, download the installer for JetBrains MPS for Apple Silicon directly from our website or get it from the Toolbox App.

Auto-import settings

With MPS 2021.1, the Import Settings dialog that appears every time you install a new version of MPS will only be shown when you don’t have the appropriate settings and configurations.

Improved accessibility

In this release, we’ve added more labels to UI elements on the Welcome screen, in the Project Structure view, and in the VCS log. These elements, as well as gutter icons, are now read out correctly when a screen reader is enabled. We are also working on improving accessibility support for macOS users.