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

2.0 M1

XML

  • a handy way to define event based xml parser (SAX) in xmlQuery language

Performance and memory consumption

  • faster project close
  • faster stubs reload
  • ctrl-n performance improved

Paste from Java

User can copy Java code as text and paste into MPS editor as base language.

There are 3 modes of such a paste: paste as class, paste as methods and paste as statements.

If a user selects an appropriate paste mode and all names in the copied piece of code are known then the pasted base language code is fully legal.

If a user selects some statements and pastes as methods or selects several methods and pastes as statements MPS will not break but the result of paste will be strange.
Unresolved names from copied code are pasted as unresolved references with an appropriate resolve info.

Better look of java stubs

Obsolete QueryMethodIdEditorProviderExpression concept was removed from editor language

QueryMethodIdEditorProviderExpression concept was removed from editor language (it was visible in completion menu with query method cell provider alias). Looks like nobody uses this expression anymore, so no migration script was created. If you by any chance open a model created in previouse version of MPS and using this expression:

now you'll see just red error editor cell instead of it.

You still can access model information from this error cell

Icon

If you need to access content of this error cell you can: select this cell, invoke popup menu and choose "Show Node in Explorer" action to see current content of this cell in Node Explorer view.


Analyzers language

jetbrains.mps.analyzers

This language allows to create user-defined data flow analyzers.

To create a custom dataflow analyzer you need to create your own instructions, rules and analyzer.

There are two types of dataflow constructors (rules): concept rules & pattern rules.

Pattern rules are applied to every node which matches containing pattern. Custom instructions can be inserted before or after nodes. 

Pattern rule example:


For every node matching this pattern, nullable analyzer inserts instruction "nullable(p)" after the node, matching ifStatement and instruction "notNull(p)" before the node, matching ifTrue.
Concept rules are applied to all instances of concrete concept. 

Concept rule example:


This rule inserts notNull instruction after each dot expression. 

See Nullable Analyzer in baseLanguage dataflow aspect for more examples.

Nullable Analyzer

The first usage of analyzers language. Provides nullable state data flow analysis in baseLanguage.  

 Analyzer checks that operand of dot expression can't be null. Otherwise it reports error as in examples below:


 Analyzer supports @Nullable and @NotNull annotations:

 Also, Nullable analyzer reports errors if checking something for null/not null is superfluos:


Improved folding support in editor

  • Ability to customize presentation of folded collections/child collections was added to MPS editor description. A cell representing folded collection can be specified just like /empty cell for child collections. /folded cell is available in editor for any collections/child collections having uses folding property set to true and will be hidden for any collections with uses folding == false. Default folded cell representation (...) will be used if /folded cell was not specified.

  • Conditional Folding: ability to specify query instead static true/false value in uses folding inspector property was added.
  • Editor was modified in order to support folding feature inside editor cell collections with indent layout. From now folding feature is supported in following cell collection's layouts: vertical, table, superscript, indent.
  • Newly added possibility to customize folded cell in conjunction with folding support for editor cell collections with indent layout were used to provide existing MPS BaseLanguage editors with possibility to fold/unfold editor blocks just like with normal java editor:

  • Convenient actions for managing folding block(s) state was added to editor pop-up menu.

Annotations to restrict (or open) access to API.

Three levels of export are available now:

  • @export(public)
    this root node and all its children can be referenced from any model.
  • @export(module)
    this node and its children can be referenced only from models within the same module.
  • @export(namespace=xxx.yyy)
    this node and its children can be referenced only from modules having namespace that begins with "xxx.yyy".

Any root node can be marked with the @export() annotation by using intentions.

Unannotated nodes in MPS are @export(public) by default.

References or instances of concepts that are not allowed (when correspondent target or concept was not exported) are marked with the "usage of nonpublic API" error.

For stub libriaries default is @export(module). It is possible to annotate all roots in stub library with @export() using export line in library descriptor or save annotations from library creator untouched (when export: do not set).

Improved customViewers language

  • Added specification for viewed value type.
  • Improved getting fields values and invoking methods. Ugly syntax with specifying methods/fields names as strings was replaced with "natural" syntax (as in base language).
  • Private members support provided.

Example of a custom viewer for List:

Run configurations

  • Run configurations now can refer to a type, located in the other module.

Improved Breakpoints View Dialog

  • Toolbar with actions "Go To", "View Source", "Remove".
  • Tree view for breakpoints with grouping by module, model and node.
  • No labels