Ghc Tags Plugin published on hackage

Getting vim tags from Haskell's parsed tree

Working on a large code base, which many type level features could be easier with a proper editor support. Finding associated type class instances or open type families isn't easy at the moment. Existing solutions like hasktags do not cover all the new language features, so at times one is left is searching the tree by hand. Haskell IDE engine, will deliver a very good solution, but at this time it is still quite hard to find a good language client for vim which works out of the box.

Ghc plugin is a good fit for solving this problem, and here are the reasons why:

In the future it could be even extended with type level information.

Over last two weeks I worked out a quite nice solution ghc-tags-plugin using ghc plugin system: at the moment only the part which has access to parsed tree. This allows to output tags for:

And it includes support for:

Configuration is simple (and possibly can be still improved). For cabal you don't need to modify checked files (only cabal.project.local). Check out the readme file for instructions.

If you encounter problems with installation, the github repo contains a Makefile to remove the plugin from the cabal store, install it, list installed versions. This turned out to be quite useful during development (co-existence of the same version of the plugin which depends on an internal library may cause problems).

I have been using this plugin on a daily basis while working on IOHK code base which contains

haskell:     214521 (96.22%)
ansic:         5285 (2.37%)
sh:            1868 (0.84%)
javascript:      1019 (0.46%)
cpp:            197 (0.09%)
perl:            63 (0.03%)
lisp:             7 (0.00%)
Navigating the codebase, re-discovering where things were moved after a refactoring, discovering code in far away from my area of expertise became much easier.

It has been tested on Windows and Linux. The only requirement is: GHC version 8.6.5 or later.

Happy Haskelling!

Links