MPS 2022.3 comes with improvements to constraint rules, sync migration with MPS extensions, Kotlin stubs for the JVM, and more.
The Constraint Rules language was created to address Constraint language deficiencies. For this release, the Constraint Rules have taken a step forward in improving the usability of the language.
MPS modules serve different purposes, ranging from a sandbox to play with your language to an active plugin code to alter MPS or IntelliJ IDEA platform behavior. In MPS 2022.3, we’ve brought all these under a single umbrella. The Java Facet page for the Solution module was reworked to house all relevant settings and identify common scenarios to help language designers and users easily recognize a module’s intended use. IDEA Plugin Module Facet has been deprecated and will no longer be used. We’ve exposed the settings for Solution modules only – both Language and Generator modules take the same approach, but have their settings configured implicitly. Learn more.
MPS has always had an active community that brings value to the ecosystem and we have always encouraged users to use external libraries to enrich the product's functionality. Third-party libraries, such as MPS Extensions, have been key to improving the user experience for products built with MPS. Even though this has brought many benefits to the community, there is a significant downside – the user needs to wait for the migration of the third-party library to update the MPS version. We’ve been working together with itemis, our official partner and main MPS extension maintainer, to synchronize our releases for smoother migration to the newest version of the product.
Language designers can now reduce the amount of repetitive code by extracting it into helper methods right inside the definition root node. These additional methods can be defined in:
Intentions also allow for additional fields to preserve the values calculated in the isApplicable method to be used in the execute method.
It ‘s now possible to import stubs from compiled Kotlin/JVM libraries, while it was previously only possible to import Kotlin/Common libraries. With this improvement, it’s possible to use libraries compiled to JVM (Java, Kotlin, or mixed) through the Kotlin JVM model root in your module options. Learn more.
Several minor changes and improvements have been bundled with this new version of MPS:
this
expression can now correctly refer to a label
(e.g. this@SomeClass
).
$kotlinc_home
macro instead of a previously hardcoded
location.
It’s now possible to create a constructor call for a given call using a right transformation by typing left parenthesis. This can work for any Kotlin type that supports this operation (this is extensible for user types) and can facilitate creating a default expression for a given type, like when creating a lambda from a functional interface type.
Extension functions in scopes have been changed to not exclude compatible methods in scopes. This comes at the cost of having some items in scopes that are not applicable due to the performance of the current type of system implementation.
The automatic resolution of function references can fix references in case a non-applicable function is selected.
A new intention updates the MPSStartupScript node and sets VM options and classpath values to the current MPS values. MPS VM options and classpath values change with every new release. Previously, the user had to manually update build projects for a standalone IDE.
For every major release, we prepare instructions for migrating from older versions of MPS to ensure everything goes smoothly. Please review them carefully.