Child pages
  • What's new in MPS 2017.2 EAP3
Skip to end of metadata
Go to start of metadata

EAP3

'reference actions' substitute menu parts

Suppose you have a concept which has a reference to another concept and on creating the instances of this concept in the editor you want to show instances of the referent concept that are in scope. Now it's possible with using 'reference actions' substitute menu parts functionality that was added in Substitute Menu Language. 

reference presentation text customization options 

 

Now you can specify matching text and in-editor textual presentation for references directly in the editor aspect.

smart reference attributes

MPS already has a functionality which is called 'smart reference' that give more suitable textual presentation and code completion. Now you can enable it for a concept by annotating it declaration with 'smart reference' attribute. 

Note that other way (heuristics based on concept alias) now is deprecated and will no longer support in future releases. All existent smart reference will be migrated automatically to use the attribute.

migration of presentation query in reference constraints

Reference presentation part in the constraints aspect has been designed purely and now can be replaced with new functionality. So we decided to deprecate it and migrate it to new options. Most of the code will be migrated automatically. Some code that produced with migration can be simplified so consider to review it.

There is a case when a presentation query can not be migrated: suppose you have an editor for a concept with reference link and then have a reference constraint with defined presentation part for its reference in one of its subconcepts. If editor component doesn't overriden in subconcept, MPS doesn't know where this presentation part should be inlined. In this case, you should manually migrate the presentation part usage to prevent uncorrected reference presentation in user code. There are several alternatives to do it:

  • Simply override the editor in subconcept. Move the code from presentation part to the proper reference cell.
  • Extract the reference cell into a separate component and override the component for subconcept.
  • Create new behavior method that provides a presentation for the reference. Make reference cell delegates to created method. Override this method in subconcept.

If you are expecting that your language may be extended in another project by someone else, do not remove deprecated presentation parts. Otherwise, extending languages may be migrated improperly.

 

Shiftless code completion

You should not press shift anymore in the completion.

It supports the shiftless pattern matching now (I works same as in idea:https://blog.jetbrains.com/idea/2011/04/shiftless-code-completion-and-navigation-in-intellij-idea-105/) and substring search as before.

Here are some examples:

 

Show Item Trace

Sometimes it is hard to track how the action appeared in the completion or context assistant because of there are many substitute and transformation menus including each other.
Now you may select some action in completion (by arrows) or in the context assistant (by pressing cmd/ctrl+alt+Enter) and then press cmd/ctrl+alt+B.
You will see the trace in the project tool. This is the trace of the menu and menu part declaration which include each other starting from the top-level menu and ending with the action declaration. If the menu or the menu part declaration is explicit and is in the project, then it has bold style in tool and you can click on it and go to the declaration.
Here how it looks like when we put the caret on the statement, show completion for the variable reference and then invoke "Show Item Trace":

We see that what we see in completion is the default transformation menu for the Statement which includes the menu for superconcept which is the BaseConcept. It in its turn includes the substitute menu for the Statement, which in it's turn wraps the menu for the Expression. Then it comes to subconcepts of Expression, one of which is the VariableReference. VariableReference is the "smart reference" concept, so it tries to find all visible target of the Variable concept. So that's how the variable reference appears in the menu for the statement.

 

Cross-model generation story

In this EAP, we transform few language aspect with a help of generation plans, and restore cross-model references between language and aspect descriptors with regular mapping labels, no dirty magic ("make up a class qualified name and hope it works") involved. Affected aspects are: structure, textgen, typesystem, dataflow and constraints.

 

  • No labels