开发者

ctags doesn't work when class is defined like "class Gem::SystemExitException"

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 t开发者_开发技巧his to the maintainer of ctags?


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.


There's a patch to fix this behavior available at http://www.mail-archive.com/geany@uvena.de/msg05290.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜