Eclipse keyboard shortcut: goto function name

后端 未结 10 2119
生来不讨喜
生来不讨喜 2020-12-12 23:29

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?


Wh

相关标签:
10条回答
  • 2020-12-12 23:59

    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.

    0 讨论(0)
  • 2020-12-13 00:00

    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.

    0 讨论(0)
  • 2020-12-13 00:18

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

    0 讨论(0)
  • 2020-12-13 00:19

    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.

    0 讨论(0)
  • 2020-12-13 00:19

    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 讨论(0)
  • 2020-12-13 00:20

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

    0 讨论(0)
提交回复
热议问题