Navigation
Synopsis menus in the IDE can be used to call Rascal functions with source texts as arguments and source texts as output
Description There exists an AlgebraicDataType for contributions to the menus of the IDE. It is defined in the IDE library module. It can be used to map a menu structure to Functions that will be called when the menu item is selected.

You can use this library module to define the menu structure and menu items, after which you need to register it with the IDE:
rascal>import util::IDE;
ok
rascal>import ParseTree;
ok
rascal>m1 = popup(menu("MyMenu", [action("Example item", void (Tree t, loc s) { println("<t> @ <s>");})]));
Contribution: popup(menu(
    "MyMenu",
    [action("Example item",void (Tree, loc);)]))
rascal>registerContributions("myLanguage", {m1});
ok
Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit ask.rascal-mpl.org.