Child pages
  • Commanding the editor

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

When coding in MPS you will notice there are some differences between how you normally type code in text editors and how code is edited in MPS. In MPS you manipulate the AST directly as you type your code through the projectional editor. The editor gives you an illusion of editing text, which, howver, has its limits. So you are slightly limited in where you can place your cursor and what you can type on that position. As we believe, projectional editor brings huge benefits in many areas. It requires some getting used to, but once you learn a few tricks you'll leave your plain-text-editor colleagues far behind in productivity and code quality. In general, only the items suggested by a completion menu can be entered. MPS can always decide, which elements are allowed and which are disallowed at a certain position. Once the code you type is in red color you know you're off the track.

Warning

Remember, when the completion menu (Control + Space) is empty, typing more will never help. You either have a typo in the text or MPS cannot find the thing that you have typed. Most likely, you are missing a dependency on the model that holds the desired thing.

Code completion

Code completion (Control + Space) will be your good friend allowing you to quickly complete the statements you typed. Remember that CamelHumps are supported, so you only need to type the capital characters of long names and MPS will guess the rest for you.

...

To quickly find out the type of an element, press Control/Cmd + Shift + T. Alt/Control + F12X will open the selected element in the Node Explorer allowing you to investigate the appropriate part of the AST. Alt + F7 will enable you to search for usages of a selected element. To quickly visualize the inheritance hierarchy of an element, use Control + H.

...

The Inspector window opens after you press Alt + 2. Some code and properties (e.g. editor styles, macros etc.) are shown and edited inside the Inspector window so it is advisable to keep the window ready.

Info

We've prepared an introductory screen-cast showing you the basics of using the MPS editor.

Most useful key shortcuts

...