hasktags - small patch

Claus Reinke claus.reinke at talk21.com
Fri Feb 23 12:30:54 EST 2007

>> if we're talking interim solutions, also try something like:
>>    echo ":ctags" | ghci -v0 Main.hs
> And some more programming actually gave me that good reason once
> again: the given ghci command only gives tags for exported definitions.
> This just plain sucks for any reasonably sized module. :)

true. if you look at the code for the :browse command just following the
tag-related code, you'll see options for export-only or all top-level bindings
(compare listTags with browseModule). i didn't adapt that for :ctags, but 
someone else could. having lots of useful example code nearby was another
reason for extending ghci, rather than starting from scratch;-)

but you also have to keep in mind that haskell isn't c. as an extreme
example, there are people out there naming all their major types T, using
qualified names to disambiguate Heap.T from Tree.T. as a less extreme
example, many haskellers feel free to reuse non-exported names all over
their projects.

for the first example, the typical "offer-a-menu-of-all-matching-tags" is not
all that helpful - i'd prefer to see the qualified tags. for the second example,
the menu of tags that aren't even in scope is just plain annoying - i'd just
want to see/jump to the local tag (which means that tags for all local defs
would have to be generated, but only used when in scope).

these are just two examples of where pattern-based tags files are not 
helpful; as another one, think of type class methods: if i'm hovering over 
a list monad's return, i'd want to jump to the monad instance for lists. so, 
for haskell, i'd like to see type- and module-aware tags. etc, etc.

i guess what i'm trying to say is: current ghc-api-based tagsfile generators 
need lots more work. but working on pattern-based generators is moving
in the wrong direction, if you are interested in that kind of semantics-aware
ide. the current code, whether for :ctags or for the standalone variant, is
just a starting point. it can be extended quite a bit without having to start
from scratch, i think, but if someone has better starting points, that's fine
with me. i just want to be able to use the tools!-)


More information about the Glasgow-haskell-users mailing list