[ANN] codex - generate tags file from dependencies

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` 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. *[1]Those tags file basically contain references to functions/types definition in source code and allow "jump to definition" like functionality in text editors.* source: http://github.com/aloiscochard/codex hackage: http://hackage.haskell.org/package/codex -- *Alois Cochard* http://twitter.com/aloiscochard

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
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. -- Christian Marie - Sparkly Code Princess

On 25 April 2014 02:37, Christian Marie
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/hoo...
-- 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

On 24/04/2014 23:54, 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.
Hi, It sounds kind of similar to "haskdogs" (https://github.com/ierton/haskdogs), which I use now. Is there something more sophisticated in there which would make it worth switching :) ? Luke.

On 25 April 2014 14:55, Luke Taylor
On 24/04/2014 23:54, 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.
Hi,
It sounds kind of similar to "haskdogs" (https://github.com/ierton/ haskdogs), which I use now. Is there something more sophisticated in there which would make it worth switching :) ?
Luke.
Hi Luke, I don't think there is much differences in term of functionality, but there is clearly lot of difference in term of design (which you might not care at all as everything work fine for you!). Basically haskdogs is a shell script ported to haskell, so it rely on command line tools. OTHO codex use Cabal as a library and and deal with hackage directly... the only external command it use is `ctags`. If I were to integrate hasktags, I would do it as a library which would make possible to remove completely the platform dependency (basically atm it's only linux/macos, but then it could work on windows).
_______________________________________________ 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

I have finally updated the tool to use `hasktags` by default as after more
in depth testing I realize that the quality is much better in term of
dealing with namespaces.
In fact I made the tagger command fully configurable (with template for
hasktags and ctags), the tool now store as well a 'hash' of the dependency
graph in the tags file to avoid recomputing it when there is no need (that
easy to integrate the tool as hook).
More information in the README:
https://github.com/aloiscochard/codex#usage
Cheers
On 24 April 2014 23:54, Alois Cochard
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`
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.
*[1]Those tags file basically contain references to functions/types definition in source code and allow "jump to definition" like functionality in text editors.*
source: http://github.com/aloiscochard/codex hackage: http://hackage.haskell.org/package/codex
-- *Alois Cochard* http://twitter.com/aloiscochard
-- *Alois Cochard* http://aloiscochard.blogspot.com http://twitter.com/aloiscochard http://github.com/aloiscochard
participants (3)
-
Alois Cochard
-
Christian Marie
-
Luke Taylor