MPS 2018.1 is finally here!
This our first release of this year. MPS 2018.1 is here to solve problems and create solutions.
Show reflective editor for the subtree
Now you can show the reflective editor for a whole subtree. To do so, select the node and press Cmd/Ctrl+Shift+[ or choose “Show reflective editor for subtree” from the context menu. For going back to the regular editor, press Cmd/Ctrl+], Cmd/Ctrl+Shift+] or right-click the option “Show regular editor for the Subtree”.
Transformation menu for property and reference cells
The transformation menu language has been consistently enhanced to support property and reference cells. The property and reference transformation menu parts allow you to customize the menus for property and reference cells better than the “inline menus” that were used previously.
The two key advantages are:
- They can be attached to any cell; not just property and reference cells.
- They can be applied to the completion as well as to the other locations – context assistant, context menu, and side-transformations.
SModel language enhancements
In some cases, you have to deal with raw pointers (like SNodeReference or SModelReference). Working with them can be puzzling since it’s hard to create and operate them. To make working with pointers easier we have brought in new types and operations for the SModel language.
We have made working with node pointers easier, by introducing a new “node-ptr<>” type. These pointers can be resolved to the actual nodes via the “resolve” operation. The “node-ptr/ … /” expression is a replacement for the old “nodePointer/ … /” construct, which is already deprecated. Migration scripts are created to take care of the conversion of the expressions.
Setting references with pointers
When setting a target to a reference link, there is no need to access the target node. A pointer to the target is enough. The “set ptr” operation applicable to reference link access expressions sets the reference target to the specified pointers. To check that a node is the one specified by a node pointer, the new “is“ operation can be used.
The “model-reference” type has been refactored into “model-ptr<>”. This pointer can be resolved to the actual model via the “resolve” operation.
Strict typing rules for SModel types
The typing rules for SModel types have been made stricter. The SNodeReference interface methods are no longer available on “node-ptr” values. The downcast operator should be used to explicitly obtain the SNodeReference. Additionally, the “pointer” operation on node instances now returns “node-ptr” instead of the regular SNodeReference.
Node-ptr expressions in reference macro
The reference macro was modified to accept node-ptr expressions. We verify the pointer type returned from the reference macro in accordance with the type of the reference.
Node Id to specify pointer
New Migration scripts
We have introduced a couple of migration scripts that may help you migrate old SModel Language constructs like the node/…/` expressions, undesirable quotations or downcasts. To run them, go to Tools -> Scripts -> Enhancements… and choose “SModel Language Enhancements (node-ptr<> and model-ptr)“. Also, in the same window, there is the “Use node pointers in reference macro queries” option available that handles old constructions in the generator macros.
Improved scoping for SModel queries
SModel queries now behave more intuitively towards the scope they operate on. If a scope is declared as a parameter to a specific query, the query is executed on the whole scope including any read-only models, not just from the editable models, like it was before.
We hope these features help you with the development of your projects. Keep reporting any bugs to our issue tracker, we are really listening. Find the complete list of issues that we have solved here.
Have a great day!
Your JetBrains MPS Team
The Drive to Develop
Subscribe to Blog updates
Thanks, we've got you!