eclipse Ctrl+单击 Atom 编辑器中的函数名称并跳转到它
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/35803243/
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
Ctrl+Click on a function name in Atom editor and jump into it
提问by Jose Serodio
I've been trying to think of a better way to title this question, but unfortunately I have no idea how to explain it. Also I haven't found this on stack overflow (for the same reason stated above).
我一直在想一个更好的方法来命名这个问题,但不幸的是我不知道如何解释它。我也没有在堆栈溢出时发现这个(出于同样的原因)。
In Eclipse, I used to Ctrl+Clickin the name of a method call (in java). And my cursor would jump in to the definition of my method function.
在 Eclipse 中,我曾经在方法调用的名称中使用Ctrl+单击(在 Java 中)。我的光标会跳转到我的方法函数的定义。
Question 1: Does anyone know the name of this behavior? I mean, maybe it's called function jumping or something like that.
问题 1:有人知道这种行为的名称吗?我的意思是,也许它被称为函数跳转或类似的东西。
Also I was searching for a plugin like this in Atom editor. Because I've tried to use this a lot of times (bad habits) and didn't work.
我也在 Atom 编辑器中搜索这样的插件。因为我已经多次尝试使用这个(坏习惯)并且没有奏效。
Question 2: Name of the plugin to do this in Atom?
问题 2:在 Atom 中执行此操作的插件名称?
Don't know if it helps, but I'm coding in JavaScript at the moment in Atom editor.
不知道它是否有帮助,但我目前正在 Atom 编辑器中使用 JavaScript 进行编码。
采纳答案by cacoder
As the other answer noted, alt-click over a method/function name can jump you directly to where it was originally defined. It works within the same file, but it doesn't seem to work across files.
正如另一个答案所指出的,按住 alt 键单击方法/函数名称可以将您直接跳转到它最初定义的位置。它在同一个文件中工作,但似乎不能跨文件工作。
The closest Atom editor package I've found for javascript which allows you to jump to function/method definitions across files is called TernJS.
我为 javascript 找到的最接近的 Atom 编辑器包称为TernJS,它允许您跨文件跳转到函数/方法定义。
Once installed, you can use ctrl-shift-r
over the word (function/method, variable etc) to bring up a list of where that method/function is defined (includes line # & filepath). You can then click on the list item & it will jump you to the definition.
安装后,您可以使用ctrl-shift-r
单词(函数/方法、变量等)来调出该方法/函数定义位置的列表(包括第 # 行和文件路径)。然后,您可以单击列表项,它将跳转到定义。
Here is a video I made containing an example of using this atom package. http://www.youtube.com/watch?v=cFAzqvYoHJs&t=11m58s
这是我制作的视频,其中包含使用此 atom 包的示例。 http://www.youtube.com/watch?v=cFAzqvYoHJs&t=11m58s
回答by C.Gadd
To answer your first question this 'behavior' is knows as 'go to definition', or 'jump to definition'.
要回答您的第一个问题,这种“行为”被称为“转到定义”或“跳转到定义”。
To answer your second question some packages you could perhaps take a look at would be,
要回答您的第二个问题,您可能会查看一些软件包,
I find these help a bit but still don't achieve the standards that I would fully like. I wanted something similar to the Intellij IDEA ctrl+ click.
我觉得这些有点帮助,但仍然没有达到我完全喜欢的标准。我想要类似于 Intellij IDEA ctrl+ click 的东西。
I find myself using the ctrl+ shift+ fto search the entire project for the related files of the thing I'm searching for. Then I find the particular file i'm looking for and shazam! I've got what I came to get. This particular method works best for me.
我发现自己在使用ctrl+ shift+f在整个项目中搜索我正在搜索的东西的相关文件。然后我找到了我正在寻找的特定文件和shazam!我有我想要的。这种特殊的方法最适合我。
I know its not exactly what your looking for but this is the best thing I've found so far to achieve something similar to what we both seem to be looking for. Hope this helps a bit, happy coding...
我知道这不完全是您要寻找的东西,但这是迄今为止我发现的最好的东西,可以实现与我们似乎都在寻找的东西类似的东西。希望这会有所帮助, 祝您编码愉快...
回答by Vanuan
Currently this behavior is blocked by multiple cursors feature.
The closest you can get is "ctrl-alt-shift-d" + atom-ternjs
目前这种行为被多个游标功能阻止。你能得到的最接近的是“ctrl-alt-shift-d”+atom-ternjs
回答by Nebulosar
try atom/navigate
尝试原子/导航
It helps you to do this excact thing.
它可以帮助你做这件事情。
The only thing is that it's default key is f2 instead of cltr+click
唯一的问题是它的默认键是 f2 而不是 cltr+click
But this is also editable in the package settings in de .atom file
但这也可以在 de .atom 文件中的包设置中进行编辑