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

Posted by dan on Stack Overflow See other posts from Stack Overflow or by dan
Published on 2010-04-04T17:23:10Z Indexed on 2010/04/09 4:53 UTC
Read the original article Hit count: 374

Filed under:
|
|

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?

© Stack Overflow or respective owner

Related posts about ctags

Related posts about ruby