Child pages
  • What's New in 2020.3
Skip to end of metadata
Go to start of metadata

Improved Switch Statement in baseLanguage

 A switch concept now supports multiple cases (MPS-31930)

Editing experience was changed.

Version control system improvements

Improved root annotation

Old root annotation algorithm used the results of the annotation obtained from the model text file. It worked for text-persisted models only and was not quite correct in the majority of cases. In the new approach the annotation is constructed by comparison of the models for different revisions.

Each cell in the editor can now be annotated using the "Annotate cells" popup option:

As a result one can see the latest change for each editor cell in the cell tooltip:

It is also possible to highlight all changed cells for a selected revision in the Annotation column:

Tracking moved nodes in the Diff dialog window

An existing algorithm for calculating changes between two models could not detect certain types of the changes. Node movement was detected as two independent changes, insertion and deletion. Now it is possible to show it as one movement change. Besides it is also possible to detect internal changes inside the moved piece:

One can choose whether to track moved nodes or not in the Diff dialog window:

Sometimes the order of the sibling nodes is not important. One can hide unimportant permutations of such siblings using the new option "Hide Unordered Moves".

Hiding resolve info only changes

In the Diff dialog window it is added a possibility to hide reference changes where only the resolve info part of the reference has been changed.

 

New $CALL-SITE$ template macro 

There's a new macro (provisionally, $CALL-SITE$. The name could get changed if we find better alternative) that facilitates insertion of a node attributed with a SWITCH/CALL macro in a designated place of invoked template. Prior to the change, template node with SWITCH/CALL macro attached has been generally ignored, now, in case invoked template/switch manifests its desire to use 'call site node', the node is processed as a regular template and the outcome is supplied to invoked template/switch as an implicit argument, ready to get inserted into desired location. One can look at this functionality as an inverted $WEAVE$. With the latter, its template node serves as a parent for child nodes coming from an invoked template. Template is evaluated and its outcome goes into result of template node (iow, invoked template produces descendants). While with the former, outcome of a template node get inserted into a designated place of an invoked template (or switch), thus template node $CALL-SITE$ annotates being the one to produce descendants.

Here we see invocation of reduce_Comment template serving as a 'call site' for reduce_MethodDeclaration template:

If we take a look into the template, there's use of supplied call site node with $CALL-SITE$ statement in the method body:

Besides, there's also invocation of reduce_Expressions switch, parameterised with a template node (trace method call) with some property macro and a reference macro (that get method call point to a proper method declaration elsewhere). Inside the switch, $CALL-SITE$ replaces a placeholder method call with the one coming as a 'call site node':

 

Template/switch declaration has a flag (presently, toggled by intention) that indicates it would like to use call site node (it's an error to use $CALL-SITE$ macro inside a template/switch that didn't flag the need to get call site). There's no need to specify any explicit argument in CALL/SWITCH, MPS generator notices template/switch being invoked needs call site and evaluates further templates (including macros) of CALL/SWITCH prior to processing it.

This functionality comes handy in scenarios like conditional type casts (IF needCast (Type) expression ELSE expression) or conversions (switch { case Double : Double.valueOf(expression); case Integer : Integer.valueOf(expression, 16); ...} when there are multiple sources of expression that may serve as an input, and it's therefore impractical to have dedicated switch/template for each case.

New errors/warnings/infos presentation in Logical View

Dynamic usages highlighting in the editor

This feature is very similar to the existing Highlight Usages action (Ctrt/Cmd Shift F7). The difference is that dynamic highlighting works automatically as you type or navigate in the code. References to the node under cursor are highlighted in the edited document after a small delay (to avoid distraction). You can still use the original Highlight usages action to "pin" the usages of the currently selected node while you navigate away from it and Dynamic highlighting will continue to highlight the node under the cursor.

This feature can be turned on or off in the MPS Editor settings (Usages of element at caret checkbox)

Change in handling module facets

MPS no longer forces any specific module facet for any module. Facets associated with a module are recorded inside module descriptor file which is the ultimate source of information now. We made 'Tests' facet completely optional in previous releases, now the last one, 'Java', is no longer enforced. Beware, unchecking 'Java' module facet in Language module properties would exclude the language from classloading mechanism and render completely different experience. The reason behind the change is to facilitate unobtrusive support for target languages other than Java.

New Welcome Screen

  • No labels