当类定义为“class Gem::SystemExitException”时,ctags 不起作用
您可以在这样的命名空间中定义一个类
class Gem
class SystemExitException
end
end
,或者
class Gem::SystemExitException
end
当代码使用类定义的第一种方法时,ctags 会像这样索引类定义:
SystemExitException test_class.rb /^ class SystemExitException$/;" c class:Gem
对于第二种方式,ctags 会像这样索引它:
Gem rubygems/exceptions.rb /^class Gem::SystemExitException < SystemExit$/;" c
第二种方式的问题是您可以' t 将光标(在 vim 中)放在对“Gem::SystemExitException”的引用上,然后直接跳转到类定义。您唯一的办法是翻阅所有以“Gem::”开头的(110!)类定义,然后找到您要查找的类定义。
有谁知道解决方法?也许我应该向 ctags 的维护者报告这个问题?
You can define a class in a namespace like this
class Gem
class SystemExitException
end
end
or
class Gem::SystemExitException
end
When code uses first method of class definition, ctags indexes the class definition like this:
SystemExitException test_class.rb /^ class SystemExitException$/;" c class:Gem
With the second way, ctags indexes it like this:
Gem rubygems/exceptions.rb /^class Gem::SystemExitException < SystemExit$/;" c
The problem with the second way is that you can't put your cursor (in vim) over a reference to "Gem::SystemExitException" and have that jump straight to the class definition. Your only recourse is to page through all the (110!) class definitions that start with "Gem::" and find the one you're looking for.
Does anyone know of a workaround? Maybe I should report this to the maintainer of ctags?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
该选项为 --extra=+q,但 ctags 仅支持 C++、Java 和 Eiffel。
http://ctags.sourceforge.net/faq.html#7
所以是的,您必须请求为 Ruby 扩展 +q 模式。
The option would be --extra=+q, but ctags only supports it for C++, Java, and Eiffel.
http://ctags.sourceforge.net/faq.html#7
So yes, you would have to request that the +q mode be extended for Ruby.
http://www.mail- archive.com/[电子邮件受保护]/msg05290.html
There's a patch to fix this behavior available at http://www.mail-archive.com/[email protected]/msg05290.html