Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Generate tags for dependent haskell packages #1

Open
jsynacek opened this issue May 19, 2021 · 6 comments
Open

Feature request: Generate tags for dependent haskell packages #1

jsynacek opened this issue May 19, 2021 · 6 comments

Comments

@jsynacek
Copy link

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.

@jimenezrick
Copy link

Yeah, something like this: https://github.com/aloiscochard/codex
Which you can use to index all dependent packages very easily.

@arybczak
Copy link
Owner

arybczak commented Nov 23, 2021

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?

@jimenezrick
Copy link

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.

@jimenezrick
Copy link

jimenezrick commented Nov 24, 2021

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 :)

@jimenezrick
Copy link

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 :)

@jimenezrick
Copy link

Just for awareness, i ended up writing a small tool for this:
https://github.com/jimenezrick/cabal-project-tags

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants