| Summary: | F3 (Open Declaration) should navigate to method declaration in the interface | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Deepak Azad <deepakazad> |
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
| Status: | RESOLVED WORKSFORME | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | daniel_megert, markus.kell.r, remy.suen |
| Version: | 3.7 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
foo() is the closest declaration here. Of course one could also argue for the other approach but that's how it's done since 2.0. No plans to change that now. (In reply to comment #1) > foo() is the closest declaration here. I thought IA#foo() is the declaration and A#foo() is the implementation, no? To be specific about what I am looking for... - select 'foo' at '1' (or '2') > Press F3 => you reach 'X' (or 'Y'). I am ok with this behavior - select 'foo' at 'X' (or 'Y') > Press F3 => I expect to reach the interface package p; interface IA { void foo(); } class A implements IA{ public void /*]*/foo/*[*/() { //X } void bar() { foo(); //1 } } class B extends A{ public void /*]*/foo/*[*/() { //Y } void bar() { foo(); //2 } } Or is there another *easy* way to navigate to the Interface? (In reply to comment #2) > Or is there another *easy* way to navigate to the Interface? I like to use Ctrl+T (or double Ctrl+T) myself, Deepak. Well, as soon as you write "public void foo()" then that is a method declaration ;-).
>Or is there another *easy* way to navigate to the Interface?
Click on the triangle on the left.
Also note that when you call foo() on a variable which is declared of type IA, then you will end up in the interface.
(In reply to comment #1) > Of course one could also argue for the other approach hmm... I still think Open (F3) on a method declaration (public void foo) should navigate to the interface, instead of doing nothing. (In reply to comment #4) > Click on the triangle on the left. The triangle just takes you one level up in the hierarchy, not directly to the interface. (In reply to comment #3) > I like to use Ctrl+T (or double Ctrl+T) myself, Deepak. This is at least 4 keystrokes but I guess it is the best way right now. "declaration" in this context means the source location where the selected Java element is declared, not the declaration in terms of the Java language model (so I agree there's nothing to change here, since we shouldn't mix multiple meanings into one command). In my workspaces, "Navigate > Open Super Implementation" is bound to Shift+F3. |
- Select A.foo() in the following snippet - Press 'F3' (Open declaration) => nothing happens Shouldn't the action navigate to the method declaration in the interface ? package p; interface IA { void foo(); } class A implements IA{ public void /*]*/foo/*[*/() { } }