ghc-tags
ghc-tags copied to clipboard
Feature request: Generate tags for dependent haskell packages
It would be nice to have an option (maybe not enabled by default) to also generate tags for the dependent packages specified in the cabal file, including base. There is a project that does something similar, see https://github.com/ierton/haskdogs.
Yeah, something like this: https://github.com/aloiscochard/codex Which you can use to index all dependent packages very easily.
Oh, I didn't know about codex
. Wouldn't it be better to add support of ghc-tags
to codex
though, considering it can already handle both hasktags
and ctags
?
ghc-tags looks feature rich and tightly integrated with GHC, which i think is great, my personal preference would be to enhance ghc-tags to be more cabal/project aware and locate all the source files all of the packages to index, but that's just me preference.
The support inside codex would be more ad-hoc, but again, just my 2c.
I was having a look how codex
does it, and cabal downloads all the source files used for build under ~/.cabal/packages/hackage.haskell.org
, the problem is, it ends up in there as tarballs. Seems like codex identifies the dependent packages and unpack them: https://github.com/aloiscochard/codex/blob/6edbdc34357d13e52b434c19665725684cdd2dba/src/Codex.hs#L148
If we would get all the tarballs unpacked (we could use a bash script), we could run ghc-tags
recursively under ~/.cabal/packages/hackage.haskell.org
directly as i saw:
source_paths - a list of paths for ghc-tags to process. Directories are traversed recursively.
Just thinking that with a simple script, ghc-tags
can run directly there and give you some tags out of the box as it is now :)
I was playing doing some plumbing with these tools:
-
cabal-plan
: to show the exact dependencies of the current project - poor man's script (bash): to unpack those dependencies source tarballs from
~/.cabal/packages/hackage.haskell.org
-
ghc-tags
: to index all those folders
...and success :)
Just for awareness, i ended up writing a small tool for this: https://github.com/jimenezrick/cabal-project-tags