Ctags does not work when a class is defined as "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 the code uses the first class definition method, ctags indexes the class definition as follows:

 SystemExitException test_class.rb /^ class SystemExitException$/;" c class:Gem 

In the second case, ctags indexes it as follows:

 Gem rubygems/exceptions.rb /^class Gem::SystemExitException < SystemExit$/;" c 

The problem with the second method is that you cannot place your cursor (in vim) using the link to "Gem :: SystemExitException" and jump directly to the class definition. Your only resource is to look at all class definitions (110!) That start with "Gem ::" and find the one you are looking for.

Does anyone know of a workaround? Maybe I should report this to the ctags employee?

+4
source share
2 answers

The parameter will be --extra = + q, but ctags only supports it for C ++, Java and Eiffel.

http://ctags.sourceforge.net/faq.html#7

So yes, you will need to request a + q extension for Ruby.

+3
source

There, the patch fixes this behavior, available at http://www.mail-archive.com/ geany@uvena.de /msg05290.html

+2
source

Source: https://habr.com/ru/post/1305976/


All Articles