Run a node via code

Hello,

I would like to run a node via code, like with the [Run <project>] menu item in the Run menu:

Is this possible?

Thanks!

4 comments

Hi, not sure what "running a node" means.

But you can provide context sensitive actions in the context menu.

Your action would contain the code that you want to execute once the user selects the menu entry. The "isApplicable" block of an action allows you to provide the "context-sensitivity" logic.

Use a plugin solution to add your action to the popup menu. You might want to look at http://127.0.0.1:63320/node?ref=r%3A00000000-0000-4000-0000-011c895904a4%28jetbrains.mps.ide.actions%29%2F1951613054411714136 or similar group declarations as examples, I believe the important bit is the "is popup" flag at the very top.

Let us know if actions and plugin solutions are new to you and we can provide more specific help.

0

By running a node i mean that i have a node decorated with IMainClass and i can click the "Run" action on the menu to run it
I wanted to be able to run this action inside the editor (swing componenent)

And yes i'm fairly new to actions though i digged in a bit :D

0

Maybe what are you asking for is intentions.

Inside intentions, you can write the BaseLanguage code you want.

0

Well yeah i can too.

And that's the point, i don't really know how to run a build configuration.

I am now trying to create actions to do that instead.
What I exactly want to do more precisely is to run one of the run configurations

I was able to make the project using my action, but is there also a way to call an action<SomeAction> from an action? Instead of copy pasting the action's code.

But i wasn't able to actually run it, there was no action for it whatsoever.

0

Please sign in to leave a comment.