Child pages
  • MPS plugin for IntelliJ IDEA
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

MPS 2.5 can be run as a plugin for IntelliJ IDEA enabling MPS-based DSLs to be used directly in a Java IDE and so interoperate tightly with other elements of the project.

Integration with IDEA Project structure.

To enable MPS features inside particular java project module one can simply add MPS facet to this module using Module Settings dialog:

It is recommended to create dedicated java source root for storing model files and specify it using Add Model Root button on Soures tab of MPS Facet configuration page:

Model root folders looks just like any other source roots in IDEA, but in addition to regular source root content it is possible to create models there:

It's necessary to specify model name and choose one of available model kinds inside New Model dialog:

Model kind in this case means a set of preconfigured used languages for new model. Used languages list can be always modified by pressing Alt+Enter on model node inside Project Tree:

Model Node in Project View represents MPS model contents and just like in MPS this it is similar to java package, so you can create model elements (Roots) inside it:

Similar to new model dialog you can specify new root name and kind (Concept) here:

Model root nodes are represented in Project View and looks very similar to other files in IDEA. Projectional editor can be opened by double-click on root node:

Code Generation.

The code will be generated for MPS models as a part of make/rebuild project actions:

It's possible to configure where to store generated sources inside MPS facet settings. Generated code can be used only during the compilation process and not saved on local disk, saved in another source folder of this module or saved in any other directory:

All generation-time errors are prorated into the Messages view just like any other compilation problems with possibility to navigate to corresponding model elements:

<create screenshot here>


Unfortunately it's not possible to run program using MPS nodes right node - generated code should be used to execute program, but it is possible to set a breakpoint directly inside DSL so IDEA debugger will be stopped in appropriate place to explore stack trace and variables:

  • No labels