![]() |
| Photo by thom masat on Unsplash |
I looked up what solutions were available, and the only option that seemed good enough was using the classic
ctags/etags/gtags I hadn’t used since my C days.Having a tags implementation can bring an almost-decent jump-to-definition essentially for free: gtags (and the others) work by pre-analysing the data and generating symbol maps which are usually stored as files, the overhead in speed and memory is minimal.
Installing it can get somewhat unintuitive (specially on Mac), since you need very specific settings for it to work with emacs and especially, Scala code.
Start by installing GNU global:
brew install global --with-pygments --with-ctags --with-exuberant-ctagsThe key parts is having pygments.Aside from this you will need to export the following environment variables:
GTAGSCONF=/usr/local/share/gtags/gtags.conf
GTAGSLABEL=pygmentsggtags-mode. If you use spacemacs, you only need to activate the gtags layer.All this has become moot as soon as metals has reached a usable state: now you can have a really fast language server for Scala, written in Scala with low memory overhead.
















