Eclipse 键盘快捷键:转到函数名称
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2685467/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Eclipse keyboard shortcut: goto function name
提问by sivabudh
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?
假设我知道一个函数名,但我不知道它是在哪个文件中声明的。什么 Eclipse 键盘快捷键可以将我带到我正在寻找的函数?
What I'm looking for is similar to Eclipse's:
我正在寻找类似于 Eclipse 的:
Ctrl+ Shift+ R
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:
使用 Visual Assist X,我可以通过使用“查找符号”功能来执行此操作,该功能通过以下方式执行:
Shift+ Alt+ S
Shift+ Alt+S
回答by Narcolei
This is an old question, but for the sake of people Googling this, Ctrl+ Oopens the code outline search, which is what you were looking for.
这是一个老问题,但为了人们谷歌搜索这个,Ctrl+O打开代码大纲搜索,这就是你要找的。
回答by SuitUp
Yeah, this is an old question, but I have a better solution: what about F3? And CTRL+ Ois what Windows users are looking for.
是的,这是一个老问题,但我有一个更好的解决方案:怎么样F3?而CTRL+O是 Windows 用户正在寻找的东西。
回答by VonC
Not exactly a directshortcut, but you need to go through the Java Search dialog:
不完全是直接的快捷方式,但您需要通过 Java 搜索对话框:
(Ctrl+H):
( Ctrl+ H):
(Sergeimentions in the commentsthat you might have to select "Declarations
" in the "Limit To
" section)
(谢尔盖在评论中提到您可能必须Declarations
在“ Limit To
”部分选择“ ” )
回答by elduff
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.
不确定这是否正是您想要的,但如果您Ctrl+ H,则会显示搜索对话框。默认选项(对我来说,使用 Java EE 透视图)是 Java 搜索。我可以输入方法名称,然后选择“搜索”块下的“方法”单选按钮。请注意,'Limit To' 块的默认选项(再次对我而言)是 'References' 单选按钮。我必须将其更改为“所有出现”才能看到方法声明,而不仅仅是调用者。
回答by Robbit
Press CTRL+ Left Mouse Buttonon the name your function. Eclipse will open the clicked file with this function automatically.
在函数名称上按CTRL+ Left Mouse Button。Eclipse 将自动使用此功能打开单击的文件。
回答by user657862
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.
我使用Momentics的,所以我不知道这是在Eclipse或Momentics的插件,但如果是Eclipse的,我认为这正是你所需要的:CTRL+ Shift+ T。
回答by Cedric Reichenbach
Quick and dirty is to use Ctrl+Shift+Up/Down, which jumps between members (methods, variables) in Java.
快速而肮脏的是使用Ctrl+ Shift+ Up/ Down,它在 Java 中的成员(方法、变量)之间跳转。
回答by David Mann
If the method in question is on an interface, then using Quick Outline or F3to 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+ Ton the method to get a Quick Type Hierarchy. From the type hierarchy you can go to the implementation of the method.
如果有问题的方法在接口上,那么使用快速大纲或F3跳转到定义只会带你到接口定义。这通常不是我想要的。相反,我在我的 Mac上点击了Cmd+T获得快速类型层次结构的方法。您可以从类型层次结构转到方法的实现。
回答by SaiPawan
Simply hitting F3 by placing cursor on the function name will work for windows users.
只需将光标放在函数名称上按 F3 即可适用于 Windows 用户。
回答by Nachan C
simple 2 waysto function declarations:
函数声明的两种简单方法:
Way 1: ( Whole workspace )
Ctrl + Left Clickthe function calling place.
方式一:(整个工作区)
Ctrl+左键点击函数调用处。
way 2: ( within the same page )
press Ctrl + Fto find dialog window and type n function_nameand search.
方式2:(在同一页面内)
按Ctrl + F找到对话框窗口并键入n function_name并搜索。
these will redirect to function definition
这些将重定向到函数定义