Customising debugger actions
Answered
Is it possible to add actions to the context menu on variables in the debugger? - I'd like to be able to add an option that, when I right click and select it, runs an action and gets the contents of the selected variable - a peer with "Evaluate Expression" or "Add to watches".
Please sign in to leave a comment.
Hi Richard,
Do you mean that you want to add your action in the menu that appears on right mouse click in editor? If so, you should implement an action and add it to EditorPopupMenu group, see http://www.jetbrains.org/intellij/sdk/docs/basics/action_system.html for details.
As for action itself, are you going to implement something like QuickEvaluateAction (its Alt+Cmd+F8 or Alt+Click on expression)?
Hi Alexander,
Yes, but in the debugger variables rather than the editor, as here:
so that I can access the value of (e.g) requiredPeriods [ My popup would then create a Junit assertion for the value ].
I can't find the action group defined for this, but http://keithlea.com/idea-actions/ suggests it might be "Debugger"?
Got it now. I believe that it's 'XDebugger.Actions' group. In the action you can use following method in order to get selected variable:
Please let me know if it doesn't work.