65
votes

Suppose I know a function name, but I don't know which file it's declared in. What Eclipse keyboard shortcut can take me to the function I'm looking for?


What I'm looking for is similar to Eclipse's:

Ctrl + Shift + R

except it will search for method names instead.


Sidenote

With Visual Assist X, I can do this by using the "Find Symbol" feature, which is executed with:

Shift + Alt + S

10
Ctrl+H, set 'Declarations' radio buttonSerg
give man a fish - you gave him a breakfast, teach him how to fish and you gave him a life. A way to find any key board short cut is to go into Window->Preferences that search for a keymap, when keymap opens search for your action in question. There you go, now you can set your own key binding for that command.A_P

10 Answers

78
votes

This is an old question, but for the sake of people Googling this, Ctrl + O opens the code outline search, which is what you were looking for.

76
votes

Yeah, this is an old question, but I have a better solution: what about F3? And CTRL + O is what Windows users are looking for.

15
votes

Not exactly a direct shortcut, but you need to go through the Java Search dialog:

(Ctrl+H):

(Sergei mentions in the comments that you might have to select "Declarations" in the "Limit To" section)

Eclipse Java source search

8
votes

Not sure if this is exactly what you want, but if you Ctrl + H, that'll bring up the search dialog. The default option (for me, using the Java EE perspective) is a Java search. I can type in the method name, and then select the 'Method' radio button under the Search For block. Note that the default option (again, for me) for the 'Limit To' block was the 'References' radio button. I had to change that to 'All occurences' in order to see the method declaration, and not just callers.

7
votes

Press CTRL + Left Mouse Button on the name your function. Eclipse will open the clicked file with this function automatically.

4
votes

I use Momentics, so I'm not sure if this is in Eclipse or in Momentics plugin, but if it is Eclipse I think this is exactly what you need: CTRL + Shift + T.

2
votes

Quick and dirty is to use Ctrl+Shift+Up/Down, which jumps between members (methods, variables) in Java.

2
votes

If the method in question is on an interface, then using Quick Outline or F3 to jump to the definition will only take you to the interface definition. This isn't often what I want. Instead I hit, on my mac, Cmd + T on the method to get a Quick Type Hierarchy. From the type hierarchy you can go to the implementation of the method.

0
votes

Simply hitting F3 by placing cursor on the function name will work for windows users.

0
votes

simple 2 ways to function declarations:

Way 1: ( Whole workspace )
                  Ctrl + Left Click the function calling place.

way 2: ( within the same page )
                  press Ctrl + F to find dialog window and type n function_name and search.

these will redirect to function definition