Child pages
  • Context Assistant

Versions Compared


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


To better guide the new users through the process of creating a script in your DSL, MPS 3.4 introduces a new UI mechanism, the context assistant has become available. A context assistant shows a dynamically constructed menu with actions that are the most appropriate for a given context. The language author specifies where the menu should be shown by putting placeholders in the editor definition. The placeholders reserve screen space for the menu in advance so that the edited content does not shift around as the menu is being shown and hidden.


and the menu now suggests several possible next steps to the user.


The context assistant is a menu for invoking specific actions on particular big cell (cells whose parents are of a different concept). It's the same everywhere inside a big cell.
It's shown in a fixed position of the big cell (there may be multiple such positions though, then only the closest is shown).

The menu is not available, if there is no content for it. Besides straight actions the menu can contain hierarchical sub-menus.


We've also shot a short video illustrating use and definition of Context Assistant. You might also like to check out a screen-cast on how context assistant is being utilized for the language definition languages.


Using Context Assistant UI

If there is a context assistant available for your current cursor position, show it with Ctrl/Cmd + Alt + Enter or wait for 2 seconds.

  • Jump to the context assistant by pressing Ctrl/Cmd + Alt + Enter (Cmd+Option+Enter on Mac OS X).
  • Navigate through the menu by using arrow keys, Tab or mouse.
  • Invoke the selected menu item using Space or Enter. or mouse click.
  • Unlike the intentions menu, there is no typing-based item selection.
  • Press Escape to jump back to the editor.
  • Unlike other menus, context assistant does not prevent typing into the document while open (except for when an item in the menu is selected).

Using Context Assistant Framework