How to run or restart the currently selected run profile from within plugin code?
Answered
How to run or restart the currently selected run profile from within plugin code?
Currently running or restarting through Shift F10, I want to integrate these APIs through plug-ins.
Please sign in to leave a comment.
Hi,
Please use UI Inspector to track down the action and see its implementation:
https://plugins.jetbrains.com/docs/intellij/internal-ui-inspector.html#action
The underlying action is
com.intellij.execution.ExecutorRegistryImpl.ExecutorAction
.Hi, I implemented RunAction and registered the shortcut key, but I can't use the shortcut key to start the program in the idea.
But the default shortcut key (Shift F10) of idea can be run.
The following is the configuration and code implementation of plugin.xml.
Hi,
I don't see what the issue is. Please provide a reproducible example.
Hi, example https://github.com/licheng1013/restart-app
Instructions in this file https://github.com/licheng1013/restart-app/blob/master/src/main/java/com/example/restartapp/action/MyRunAction.java
Your shortcut conflicts with a letter in my IDE. I changed it to Ctrl+Shift+L, and it works correctly.
Action is not run, because it is disabled. According to
com.intellij.openapi.actionSystem.Presentation.setEnabled()
Javadoc,AnAction.actionPerformed()
is not executed in such a case.Set a breakpoint in
com.intellij.execution.dashboard.actions.ExecutorAction.update()
and see why it is disabled.Hi I found a way to do shift + F10 in the plugin。Thanks for your help.