First, I want to explain "why" - 'what is the goal I want to achieve'
I am currently working in Java/Kotlin code bases that are very complex; written in a very "spaghetti-code" way.
I often find myself stepping through this code, observing the values that show up under the "variables" section of the debug panel.
So, in order to help make this process easier, I want to write a plugin, that will be able to keep track of two main things:
- Keep track of a sequence of method names, in chronological order of execution
- Keep track of each of the variables and their values that were in-scope within each of these methods
What I will do is then use the method names and variable values to build a diagram where each box in the diagram is a method. When I hover over the method, I will be able to see what variable/values were in scope upon entering and exiting the method.
How am I attempting to reach this goal (above)?
I want to listen to debugger events. So that every time I hit a breakpoint, my plugin will execute code that will record:
- The function in which the breakpoint was hit
- The current variable/values that are in scope when the breakpoint was hit
I know that "projectListeners" and "applicationListeners" can be defined inside a plugin.xml file. Then the intellij plugin can have a class that @Override annotates a method so that this override method 'listens' to when the original method would get hit.
The information I'm looking for is this:
- Can you provide a complete example with the plugin.xml and the related class @Override method. This example would display a "Hello World" message whenever a breakpoint is hit in an intellij editor that has the plugin loaded
- If it's not possible to 'listen' to the debugger event in this way, could you provide a complete code example, that accomplishes showing a "Hello World" message when a breakpoint is hit, using a strategy that will work?
Thank you very much to whoever is able to help me, as a brand new intellij plugin developer.