On 25 April 2014 02:37, Christian Marie <christian@ponies.io> wrote:
On Thu, Apr 24, 2014 at 11:54:29PM +0100, Alois Cochard wrote:
> Hi,
>
> Just to let you know that I released a tool which allow to generate a
> tags[1] file for a given cabal project using the sources of all the
> dependencies of that project.
>
> `cabal install codex`

Slight issue with base 4.6 installed:

        $ cabal install --reinstall codex
        Resolving dependencies...
        cabal: Could not resolve dependencies:
        trying: codex-0.0.1.1 (user goal)
        next goal: base (dependency of codex-0.0.1.1)
        rejecting: base-4.6.0.1/... (conflict: codex => base>=4.7 &&

It does install fine with the .cabal patched to accept:

        base >=4.6 && <4.8


Oh sorry for that!
I just released a new version with a lower bound constrain at 4.6
 
> You can simply run `codex update` in one of your cabal project directory
> and you'll get a 'codex.tags' file to feed in your favorite text editors.
>
> It store the source code in the hackage local cache, and it store there as
> well the tags file per module (so the tool just aggregate per project).
>
> I hope it will be useful to other hackers, it's a joy for me in vim when
> using unknown libraries.
>
> Note: This tool actually use `ctags` but that could be easily made
> configurable if someone need it, integrating native haskell tagger is an
> option too. I personally like using ctags, it's very fast.

After generating a tags file with 'codex update', I have a bunch of references
to .c and .h files. I can't see ctags being particularly useful for cabal
projects but perhaps I'm missing something?

I would personally use your tool if it were to provide an aggregate of tag
files generated by something like hothasktags.


This is is because you have to configure your ctags to deal with haskell (and also ignore some stuff from cabal), I wanted to explain that part but I completely forgot... sorry.

It's actually quite simple, I have just updated the README with an example ~/.ctags configuration:
https://github.com/aloiscochard/codex

Be sure to delete all "tags" file in your hackage (as they were generated with a miss-configured ctags) before re-running the tool, I'll add a command to do that directly from the tool, but for now you can just:
"find ~/.cabal/packages/hackage.haskell.org -name "tags" -exec rm {} \;"

About `hothasktags`, I'm not sure how fast it is and how big is the improvement in term of quality. Maybe you could share with us which differences you see?

Honestly I don't care much about having to disambiguate manually (as i did that with other languages) and I don't think there is others difference vs using a haskell tagger, but I understand some might prefer a native tagger in which case it should be pretty trivial to plug hothasktags on any other tagger on it.

Using a tool which work cross language is actually very powerful, for example I have a githook which tag the source of the project itself [1] ... it work for all my git based project, doesn't matter which language.

I hope that help

[1] https://github.com/aloiscochard/configurations/tree/master/.git_template/hooks
 
--
Christian Marie - Sparkly Code Princess

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe




--
Alois Cochard
http://aloiscochard.blogspot.com
http://twitter.com/aloiscochard
http://github.com/aloiscochard