tags:

views:

63

answers:

1

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?

A: 

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.

NUXI