Early Access Program for MPS 2022.2
As previously mentioned, we decided to skip MPS 2022.1 as we were too busy fixing issues from the last release and didn’t have enough time to prepare the new functionality. Now we have new features to present to give you a glimpse of what’s to come in MPS 2022.2.
Annotations in Inspector
Annotations are now accessible from the Inspector window, and the annotation process will start for the entire root. This action can be accessed by right-clicking on the left border of the Inspector window. The Annotation will open in both the Inspector editor and the main editor.
Improved support in MPS Kotlin
A lot of edition issues have been fixed to provide a better typing experience, such as:
- Lambda literals:
- Support of the implicit “it” parameter.
- Lambdas whose type has a receiver (e.g. “Receiver.() -> Unit”) will properly use that receiver type as an implicit “this” inside the body of the lambda.
- Scopes have been refactored to support more use cases (e.g. custom receiver types) and improve filtering (fewer duplications, access to hidden functions).
- Support for deconstructing operators by typesystem.
- Number literals: easier insertion of floats and long, and transition between unsigned and signed numbers.
- String literals: All strings can be switched from single to multiline by pressing enter in a string literal; some insertion issues have been fixed.
- Kotlin stubs support loading of annotations and function types with receiver (eg. “T.() -> R” which were incorrectly loaded as “(T) -> R”, such as the with() function).
Due to some structural changes, several migrations are provided with the language:
- Statement support has been made generic in theIStatementHolder interface; other concepts using statements on their own have been migrated to use this concept.
- String literal and multiline literal have been merged into a single string literal concept.
- Inheritance modifier (final, abstract…) on function declarations is now mandatory because of the usage of the Inheritable interface; declarations will be migrated accordingly.
- Support for deconstructing variables has been grouped under the IDeconstructingDeclarations interface; for statement and lambda multi-parameter are migrated to use it.
- Concepts with receiver types no longer use the ReceiverType concept (which is an expression referring to a type) and hold the type directly.
- Unsigned, Long and Integer literal concepts have been grouped under the IntegerLiteral concept (which uses boolean flags). Moreover, negative number literals are no longer supported and must be created using the unary minus concept.
SModel language for MPS Kotlin
SModel support has been brought to MPS Kotlin, with the new jetbrains.mps.kotlin.smodel language. Along with the increased compilation support, it allows for the usage of Kotlin code in language modules (as helper classes for instance).
On top of regular types (node, concept, links, references), it leverages the increased flexibility of MPS Kotlin to bring concept-type parameters. Functions, variables, and classes can now declare and use such parameters and reuse them in their internal types, which allows for easier typing and leverages Kotlin smart casts.
Kotlin compilation updates
Kotlin compilation support has been improved with better persistence. As a result, Kotlin classes are no longer erased when MPS is restarted.
A new option has been added in build scripts to mark a module to be compiled with the Kotlin compiler. Insertion of this flag is manual – no automatic check is currently available to set it to true. The flag should be added when a module containing Kotlin files is going to be compiled to JVM.
Text styles available in BaseLanguage comments
When adding comments to the BaseLanguage, it is now possible to customize them further with text style. Comments support bold, non-italics, underlined, and bold-non-italics styles.
In BaseLanguage, it is now possible to do post-fix transformations that allow you to transform the code by appending some text to the expression. This saves developers time, as they do not have to navigate the cursor to the front of the expression or select the expression in order to apply a transformation.
That’s it for now. Try the new functionality and feel free to give us feedback. The release of MPS 2022.2 is coming soon, so stay tuned!
Your JetBrains MPS team
Subscribe to Blog updates
Thanks, we've got you!