Do you know an alternative ctags generator for Ruby

倖福魔咒の 提交于 2019-11-30 11:10:25
Jayram

Exuberant ctags out of the box doesn’t do a number of useful things:

  • It doesn’t deal with:

    module A::B
    
  • It doesn’t tag (at least some of) the “operator” methods like ‘==’

  • It doesn’t support qualified tags, —type=+

  • It doesn’t output tags for constants or attributes.

Patch available, but it is only for version 5.5 and does not work anymore.

Other projects:

Source

Ripper-tags effort does solve everything described here. It is based on official Ruby parser which is also quite fast. https://github.com/tmm1/ripper-tags

gem install ripper-tags
cd your_project/
ripper-tags -R

It does also support Emacs as well.

Add following to your ~/.ctags

--regex-ruby=/(^|;)[ \t]*(class|module)[ \t]+([A-Z][[:alnum:]_]+(::[A-Z][[:alnum:]_]+)+)/\3/c,class,constant/

So you can:

  • deal with: module A::B

See more here: https://github.com/bltavares/dot-files/blob/master/ctags

A patch is available as of 2013-02

the rspec tag generator will not properly recognize describe blocks that start with semicolor (:some-method), but other than that, it's great.

There is also https://github.com/eapache/starscope

It doesn't support the extended tag format (yet) but it does other things such as exporting cscope databases.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!