HTTP support plugin
The HTTP support plugin is a new feature in MPS 2017.1 that you can utilize in several useful ways. It is built on top of the built-in http server that is part of the IntelliJ platform.
Built-in server extension
The new jetbrains.mps.ide.httpsupport language enables users to write extensions that will handle HTTP requests arriving to the MPS built-in server. Nodes of the RequestHandler concept that are placed into plugin solutions will be recognised by MPS and registered with the internal HTTP server to handle the specified URLs. By default, MPS provides HTTP handlers for /node and /file URLs that open in editor the referenced nodes and Java files, respectively.
Copy Node Reference as URL
Using the context menu in the editor as well as in the Project View panel you can copy a reference to the selected node as URL. The URL uniquely identifies the node across machines and when submitted to the built-in HTTP server, it will open the referenced node in the editor. This gives you the ability to share pointers to code with others easily.
Integration with TeamCity and YouTrack
TeamCity and YouTrack leverage this functionality to ease navigation from the web front-end of these services to code. With a single mouse click on a link to a Java file in a stack trace you open that same file in your running MPS instance. Any of the "Open in IDE" links in TeamCity will do the same for nodes in models. Additionally, if you are trying to open a generated file, MPS will open its sources in a proper location.
Extensibility of generation plans
The j.m.lang.generator.plan language has been further enhanced in order to enable extensibility of the generator plans. The apply with extended statement applies in a single step the specified generators and those that extend them. This allows the language designer to accommodate for possible extensions.
Improvements to checkpoint declaration
Several statements with different semantics are now available to define checkpoints:
- checkpoint <checkpoint> - records/persists the state of the transformed model. It can either declare a checkpoint in-place or refer to a declared checkpoint.
- declare checkpoint <name> statement - specify a label that generator plans could share. This statement does not record/persist the state of the transformed model.
- synchronize with <checkpoint> statements - instructs the generation plan to look up the target nodes in persisted models of the specified checkpoint. This statement doesn't introduce any new state, but references a checkpoint declared elsewhere.
Context objects in TextGen
It is vital for certain model-to-text conversion scenarios to preserve some context information during TextGen. In BaseLanguage, for example, TextGen has to track model imports and qualified class names. The low-level approach of previous versions based on direct text buffer manipulation has been replaced with the possibility to define and use customized objects as part of the concept's textgen specification.
Find Usages for Mapping Configurations
The Find Usages functionality has been enhanced to also discover usages of MappingConfigurations in the generator's priority rules. Find Usages now looks up the occurrences of a given Mapping Configuration and shows them listed inside stubs for the project modules.
Bootstrap Dependency in a Language Accessory model
Accessory models must have the "Do Not Generate" flag set, if they use their host language. MPS cannot generate such models, since their host language depends on them during its own generation. MPS will now detect such problems correctly and raise an error.
Character Accent Menu supported in editor on MacOS
To be a good citizen of the MacOS platform, the MPS allows the users to press & hold a key in oder to use the Character Accent Popup menu for entering specific non-ascii characters.
Dropped support for substitute and transform actions
The Transform Menu Language that was introduced in the previous version has matured and so the old way of defining substitute and transform actions through the Actions aspect was removed completely. The side transformation tags represented by SideTransformAnchorTagStyleClassItem as well as CellMenuPart_ApplySideTransforms that included items of a side-transform menu in a completion menu of a specific cell have been removed as well. Language migrations will migrate your actions and remove the old definitions from your languages automatically.
Modifications in the generator of the editor language
The generator of the editor language has been significantly re-designed. Since the editor language is frequently being extended by the MPS users, this change may help a large group of MPS users to simplify the design of their editor extensions. The new generator will simplify templates, make the generated code more human-readable and use more meta-information at the generation-time instead of the run-time. See the documentation for full details.
Migration cooperates with Local History
Migrations cooperate seamlessly with Local History. After running migrations, Local History holds records of all the changes made to the project by each of the migrations. It's thus possible to review the changes and to revert any of them from the Local History view as well as from the Diff dialogs.
MPS now automates the process of creating copies of languages and solutions. The cloning process creates identical copies and handles also references to nodes inside the module itself.
New handy operation in baseLanguage.collections
In order to filter out null elements from a sequence with less verbosity, the new construct of seq.withoutNull can be used instead of seq.where(it => it != null).