tmm1 / ripper-tags

fast, accurate ctags generator for ruby source code using Ripper
MIT License
550 stars 43 forks source link

Handle `--append` for vim/emacs, composition approach #96

Closed mislav closed 4 years ago

mislav commented 4 years ago

Implements --append for Vim & Emacs formatters:

# vim:
ripper-tags -a foo.rb bar.rb
# emacs:
ripper-tags -a -f TAGS foo.rb bar.rb

The implementation of --append differs from Universal-ctags in the way that, instead of merely appending new tags from listed source files to existing tag file, the old tags that belonged to listed source files are removed. This ensures that there are no outdated tags in the final tags file.

This implementation differs from #84 in a way that it takes the composition approach via new formatter classes, rather than extending VimFormatter/EmacsFormatter with extra functionality. This is done to minimize the potential for bugs introduced to non-append mode.

Closes #84, fixes #49

mislav commented 4 years ago

Credit: @k3rni for initial spike in #84. 🙇

k3rni commented 4 years ago

Excellent!