MPS 2021.2 Is Now Available
Read this post in other languages:
MPS 2021.2, our second milestone of the year, is now ready for you to try. Just as we did for the previous release, we have put together a screencast showcasing its main features. Read on to learn about the new functionality.
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. Automatic invocation is a bit different from manual invocation in the following ways:
– It never opens in an empty cell.
– It never opens if there are no suggestions to offer.
– It closes automatically if there are no suggestions to offer.
– It closes automatically if you delete all text and leave the cell empty.
This feature can be turned on or off by toggling Show suggestions as you type in the Editor / General / Code completion section. The setting is on by default.
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
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
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 a distribution.
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.
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.
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 improvements
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
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.
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.
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
We introduced a new section in our documentation to share guidelines for a smooth migration to the new releases. With every major release, we will be updating this section with the latest tips and tricks.
That’s it for now. We hope you can take advantage of all the new features. We’ve also fixed a long list of bugs from our issue tracker. Let us know if you encounter any problems or have questions by leaving a message in the comments below or sending an email to our support address.
Have a great day!
Your JetBrains MPS team
The Drive to Develop