How to show run or debug icon in the editor for methods
Hi,
I am relatively new to IntelliJ plugin dev. The plugin I am working on allows Java Smart Contract development on IntelliJ.
Each method in the smart contract java file can be executed independently. My current solution is, user right clicks on the method name in the editor and selects a custom menu "Call" to execute the method in a simulated environment.
I would like to have a "run / debug" icon against these methods in the editor, (similar to main method in Java class or test methods in test classes) . These methods are usually annotated with a specific annotation, so we can find out which are the eligible methods to show this icon.
Any hint on :
1. How can I show the run icon against a method in editor and attach an action?
2. Any pointer on how to attach to a remote debug port through Open API automatically?
Thanks for your help.
Satya
Please sign in to leave a comment.
1) com.intellij.execution.lineMarker.RunLineMarkerContributor
2) Please explain what you want to achieve exactly. What does "automatically" mean?
Many thanks Yann.
>> 2) Please explain what you want to achieve exactly. What does "automatically" mean?
My plugin will first start an external java process in debug mode . Then it should attach the IDE debugger to the external process's debug port. (So user doesn't have to manually attach to the remote debug port.)
Please see com.intellij.xdebugger.XDebuggerManager#startSessionAndShowTab(java.lang.String, com.intellij.execution.ui.RunContentDescriptor, com.intellij.xdebugger.XDebugProcessStarter)