Ruby-on-rails ide sublime2 如何找到方法定义

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

ide sublime2 how to find method definition

ruby-on-railsrubysublimetext

提问by Lesha Pipiev

I'm using Sublime 2for Ruby On Rails programming. I need a ability to click a method name and jump to class where the method is defined. There are many IDE with similar capability...

我正在使用Sublime 2进行 Ruby On Rails 编程。我需要能够单击方法名称并跳转到定​​义该方法的类。有许多具有类似功能的IDE...

采纳答案by fraxel

Goto symbolis Ctrl-R(linux), this gives a pop-up-list of all symbol and class definitions in the file, in definition order, and you can jump to what you're after. You could do the same thing with Goto Anything, Ctrl-Pand then typing @and the method name.

Goto symbolis Ctrl- R(linux),这给出了文件中所有符号和类定义的弹出列表,按定义顺序,你可以跳到你想要的。你可以用Goto Anything, Ctrl-做同样的事情,P然后输入@和方法名称。

Also, there is a Goto Symbolplugin, which lets you jump straight to the definition of the method name your cursor is at, with a key binding or click.

此外,还有一个Goto Symbol插件,可让您通过键绑定或单击直接跳转到光标所在的方法名称的定义。

However, both those methods are limited to the current file. If you need to jump to definitions in other files, probably the best solution is the SublimeCodeIntelplugin. It seems to be working pretty well and just by hitting Ctrl-f3(linux) will open up the file at the definition you want.

但是,这两种方法都仅限于当前文件。如果您需要跳转到其他文件中的定义,最好的解决方案可能是SublimeCodeIntel插件。它似乎工作得很好,只需点击Ctrl- f3(linux) 就会以您想要的定义打开文件。

回答by alienhard

Another solution is CTags.

另一个解决方案是CTags

SublimeCodeIntel seems to be pretty buggy judging from unresolved issueson the Github tracker. Also it crashes for me, probably because the code base I'm working on is too big...

从Github 跟踪器上未解决的问题来看,SublimeCodeIntel 似乎有很多问题。它对我来说也崩溃了,可能是因为我正在处理的代码库太大了......

What I'm using now is the CTags package. There's no "intelligence" but it allows you to jump to definitions and back very easily and it is super fast.

我现在使用的是CTags 包。没有“智能”,但它允许您非常轻松地跳转到定义和返回,而且速度非常快。

回答by Eran Or

upgrade to sublime text 3 and then put cursor on function name and click F12 to go back ALT+- or from the menu click on Goto

升级到 sublime text 3,然后将光标放在函数名称上,然后单击 F12 返回 ALT+- 或从菜单中单击 Goto