Bug 406872 - [navigation] Add prompt for Open Declaration for overrides
Summary: [navigation] Add prompt for Open Declaration for overrides
Status: CLOSED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.8.2   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2013-04-30 04:56 EDT by Chris S CLA
Modified: 2013-04-30 06:34 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris S CLA 2013-04-30 04:56:00 EDT
This is a feature request, not a bug.

When doing "Open Declaration" on a method in java code, I often do not want to go to the interface or class declaring the method, but rather to some specific subclass overriding it.

Would it be possible to add some kind of prompt that lists the existing overrides in known classes and give me a selection of which one I want to open (including the declaring class, of course). Alternatively a separate shortcut "open declaration with prompt" if the default behavior should be preserved.

If that would be too much work to implement, it would be nice with some kind of warning saying "this method is overridden in one or more subclasses", which would at least help me a bit. As it is now, I've spent quite a bit of time trying to understand some code in the top-level class, when it has been overridden so that it is never executed which I sometimes forget to check until I enter the debugger.

This has some similarities to the feature request 385310 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=385310) but that one is more advanced and requires context-awareness, which this one does not.
Comment 1 Dani Megert CLA 2013-04-30 05:23:26 EDT
Did you try Ctrl+Click on a method? This allows to go to the declaration or the implementation. There's also Navigate > Open Implementation. Both will directly go to the implementation if there's only one, or show a popup with all possible implementations.
Comment 2 Chris S CLA 2013-04-30 06:34:22 EDT
Hi Dani,

thanks, the Navigate->open Implementation does what I needed. I can't believe I've never noticed that one (Ctrl-click doen't seem to do what I wanted though, but the above is sufficient).

I'm closing this report (setting it to "invalid"), sorry for the noise.