在 Eclipse+Pydev 中转到定义的 [快捷方式/其他方式] 是什么

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2107301/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 19:08:18  来源:igfitidea点击:

What is the [shortcut/other way] for go to definition in Eclipse+Pydev

eclipsepydev

提问by agiliq

I used to use WingIde, where in a shortcut(f4, default) which I used quite often was Goto definition, which will open the definition file, and take me to it. Is there a similar shortcut for eclipse+pydev?

我曾经使用WingIde, 其中我经常使用的快捷方式(f4,默认)是 Goto 定义,它将打开定义文件,并将我带到它。eclipse+pydev 有没有类似的快捷方式?

回答by VonC

For Aptana Pydev, you have "Go To Definition": F3
(Andrew Falangacomments belowthat Alt+allows you to return to the point you left)

对于的Aptana Pydev的,你有“转到定义”: F3
安德鲁打脚板刑罚下面的评论Alt+可以让你回到你留下点)

The 'go to definition' actions enables you to get to a given definition.

  • It works well on 'self' tokens
  • It can work on methods / attributes from parameters (as the image below shows).

“转到定义”操作使您能够到达给定的定义。

  • 它适用于“自我”令牌
  • 它可以处理来自参数的方法/属性(如下图所示)。

goto definition

转到定义

回答by Fabio Zadrozny

As others answered, F3 is the way to go, but going a bit further, you might also want to take a look at ctrl+shift+t to browse all the tokens available and ctrl+shift+r to browse all the files.

正如其他人回答的那样,F3 是要走的路,但更进一步,您可能还想看看 ctrl+shift+t 来浏览所有可用的标记,并使用 ctrl+shift+r 来浏览所有文件。

回答by Frieda

Although the question is pretty time-barred, maybe this more general approach will help others looking for specific short-cuts in eclipse.

虽然这个问题是有时间限制的,但也许这种更通用的方法会帮助其他人在 eclipse 中寻找特定的捷径。

Help - Key Assist... opens a list of all available short-cuts, alphabetically sorted by description. ("Open Declaration" was the one looked for here.)

帮助 - Key Assist... 打开所有可用快捷方式的列表,按描述的字母顺序排序。(“开放宣言”是这里寻找的那个。)

Window - Preferences - General - Keys lets you edit the short-cuts.

Window - Preferences - General - Keys 让你编辑快捷方式。

回答by jason

Assuming you mean "go to where a method/class/variable" is defined, in Eclipse, it is F3

假设您的意思是“转到定义方法/类/变量的位置”,在 Eclipse 中,它是 F3

回答by Vit Bernatik

Actually it does not work when you set MSVC scheme. In eclipse mars go to Windows->preferencesthen go to General->keys(or in type filter texttype keys) then in Keysin type filter texttype definition. Then you shall see in commandbelow Python Go To Definition. In Bindingtext edit you can then set any shortcut you want.

实际上,当您设置时它不起作用MSVC scheme。在 eclipse mars go to Windows->preferencesthen go to General->keys(or in type filter texttype keys) then Keysin type filter texttype definition。然后你会在command下面看到Python Go To Definition。在Binding文本编辑中,您可以设置所需的任何快捷方式。