Strategies for debugging a refactoring operation in a custom plugin? [message #1714191] |
Tue, 10 November 2015 10:32  |
Eclipse User |
|
|
|
This is a stretch to ask this here, but I'm just looking for ideas for how to debug a problem in a codebase.
I've inherited a somewhat complex Eclipse plugin codebase. It's used for the purpose of editing files in a specific language. I'm pretty new to maintaining Eclipse plugins. The original authors are not easily available.
The language has some similarities to XML (not in the syntax), in that one module can "import" another by name, and specify a prefix to be associated with the symbols from that imported file. The language also has a "use" command, which takes a symbol name that represents sort of a structured type. The symbol name can be with or without a prefix. The structured type can be defined in that module, or in an imported module.
The plugin has a feature whereby I can select the definition of a symbol name and select "Rename" in the "Refactoring" submenu. It will select all the occurrences of that symbol name in the file and prompt me to rename it, just like how the Java editor (and others) work.
The problem is, some of the occurrences it chooses to replace might not be valid. If I selected a symbol name in that module that happens to be the same name as a symbol in an imported module, which is referenced by a prefix in this module, when I select the "Rename" operation, it will mark those prefixed occurrences also, even though they refer to a different symbol.
What's befuddling me is that even though I have full access to the source code of this plugin, I can't figure out where it's determining which symbols to select. I did find a "RenameAction" class, which extends Action and implements ISelectionChangedListener, but nothing in there appears to have this logic. I imagine there must be something "inherent" in what this is doing, such that the logic is already provided in the SDK, I just don't see where this comes in.
I did try setting breakpoints in this code, but I found it was somewhat dangerous. I ended up locking up my entire system when it populated a popup menu while I was at a breakpoint (only the mouse cursor and the power button were operational at this point).
I could use any ideas for tracking this kind of issue in Eclipse plugins. I imagine there are other plugins with similar behavior.
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03366 seconds