
Hi, I'd like to draw attention to a little script I wrote. I tend to use qualified imports and short names like "new" and "filter". This makes hasktags pretty much useless, since it basically just guesses which one to go to. hothasktags is a reimplementation of hasktags that uses haskell-src-exts to analyze the import structure to generate (scoped) tags pointing to the right definition. I'm pretty addicted to it, since it provides the only functionality I miss from visual studio :-). VIm only for now, since I don't know if emacs tags format supports scoped tags. I am aware that it is not perfect -- patches and bug reports welcome. http://hackage.haskell.org/package/hothasktags Luke

On Thursday 1. April 2010 22.46.47 Luke Palmer wrote:
I'd like to draw attention to a little script I wrote. I tend to use qualified imports and short names like "new" and "filter". This makes hasktags pretty much useless, since it basically just guesses which one to go to. hothasktags is a reimplementation of hasktags that uses haskell-src-exts to analyze the import structure to generate (scoped) tags pointing to the right definition. I'm pretty addicted to it, since it provides the only functionality I miss from visual studio
Thanks for this. Seems to be working very nicely. :-) -- Erlend Hamberg “Everything will be ok in the end. If its not ok, its not the end.” GPG/PGP: 0xAD3BCF19 45C3 E2E7 86CA ADB7 8DAD 51E7 3A1A F085 AD3B CF19

On Thu, Apr 1, 2010 at 1:46 PM, Luke Palmer
Hi,
I'd like to draw attention to a little script I wrote. I tend to use qualified imports and short names like "new" and "filter". This makes hasktags pretty much useless, since it basically just guesses which one to go to. hothasktags is a reimplementation of hasktags that uses haskell-src-exts to analyze the import structure to generate (scoped) tags pointing to the right definition. I'm pretty addicted to it, since it provides the only functionality I miss from visual studio :-).
VIm only for now, since I don't know if emacs tags format supports scoped tags. I am aware that it is not perfect -- patches and bug reports welcome.
Hi, thanks for this, I've been wanting something like this for a long time! I have a suggestion and a question though: If you prepend the tags file with "!_TAG_FILE_SORTED\t1\t ~\n" then I think vim should be able to do a binary search on the file. This program generates a tag for each reference to a symbol: Derive.PitchDeriver Derive/Derive.hs 98;" file:Cmd/Cmd.hs Derive.PitchDeriver Derive/Derive.hs 98;" file:Cmd/Play.hs Derive.PitchDeriver Derive/Derive.hs 98;" file:Cmd/ResponderSync.hs ... [ 20 more ] ... The vim tag documentation says these are "static" tags, and implies they are meant to apply to symbols only valid within the same file, but this is clearly not the case. Actually, the vim doc implies that only "file:" is defined, and doesn't talk about "scoped tags" so I'm not sure what is going on. Anyway, whenever I go to a tag I have to first step through a message that says "1 of 25" or so. There's one for each reference in the tags file, even though those are references in other files. What's going on? I even checked the current docs at vim.org and they don't mention a file:xyz form either.

Ohh, and the other issue I had was that setting iskeyword causes 'w' to skip over '.'s. This causes trouble for me because I'm used to using 'w' to skip between components of the symbol and 'W' to skip it entirely. Is there a workaround you use, maybe a better way to navigate?

On 04/07/2010 09:23 AM, Evan Laforge wrote:
On Thu, Apr 1, 2010 at 1:46 PM, Luke Palmer
wrote: VIm only for now, since I don't know if emacs tags format supports scoped tags. I am aware that it is not perfect -- patches and bug reports welcome.
This program generates a tag for each reference to a symbol:
Derive.PitchDeriver Derive/Derive.hs 98;" file:Cmd/Cmd.hs Derive.PitchDeriver Derive/Derive.hs 98;" file:Cmd/Play.hs Derive.PitchDeriver Derive/Derive.hs 98;" file:Cmd/ResponderSync.hs ... [ 20 more ] ...
The vim tag documentation says these are "static" tags, and implies they are meant to apply to symbols only valid within the same file, but this is clearly not the case. Actually, the vim doc implies that only "file:" is defined, and doesn't talk about "scoped tags" so I'm not sure what is going on. Anyway, whenever I go to a tag I have to first step through a message that says "1 of 25" or so. There's one for each reference in the tags file, even though those are references in other files.
What's going on? I even checked the current docs at vim.org and they don't mention a file:xyz form either.
As far as I know, there is nothing like "file:xyz" only "file:". This is to support static tags which I would not call "scoped tags" because they know only one scope: the file scope. Between, ghci can generate tags file for you with static tags too in ghc 6.12.1. The ticket which discusses this feature and also discusses emacs support for static tags is here: http://hackage.haskell.org/trac/ghc/ticket/3434 Peter.

On Wed, Apr 7, 2010 at 1:23 AM, Evan Laforge
On Thu, Apr 1, 2010 at 1:46 PM, Luke Palmer
wrote: Hi,
I'd like to draw attention to a little script I wrote. I tend to use qualified imports and short names like "new" and "filter". This makes hasktags pretty much useless, since it basically just guesses which one to go to. hothasktags is a reimplementation of hasktags that uses haskell-src-exts to analyze the import structure to generate (scoped) tags pointing to the right definition. I'm pretty addicted to it, since it provides the only functionality I miss from visual studio :-).
VIm only for now, since I don't know if emacs tags format supports scoped tags. I am aware that it is not perfect -- patches and bug reports welcome.
Hi, thanks for this, I've been wanting something like this for a long time! I have a suggestion and a question though:
If you prepend the tags file with "!_TAG_FILE_SORTED\t1\t ~\n" then I think vim should be able to do a binary search on the file.
Thanks!
This program generates a tag for each reference to a symbol:
Almost. It generates a tag for each file/symbol pair such that the symbol is accessible from the file.
Derive.PitchDeriver Derive/Derive.hs 98;" file:Cmd/Cmd.hs Derive.PitchDeriver Derive/Derive.hs 98;" file:Cmd/Play.hs Derive.PitchDeriver Derive/Derive.hs 98;" file:Cmd/ResponderSync.hs ... [ 20 more ] ...
The vim tag documentation says these are "static" tags, and implies they are meant to apply to symbols only valid within the same file, but this is clearly not the case. Actually, the vim doc implies that only "file:" is defined, and doesn't talk about "scoped tags" so I'm not sure what is going on. Anyway, whenever I go to a tag I have to first step through a message that says "1 of 25" or so. There's one for each reference in the tags file, even though those are references in other files.
Hmm odd, I don't get that behavior. Is that with the sorted annotation? What version of vim?
What's going on? I even checked the current docs at vim.org and they don't mention a file:xyz form either.
I think I saw it documented *somewhere*, but now that I look again I can't find it anywhere. Maybe it was in a dream. I hope a newer version of vim didn't remove the support or something... Luke

On 04/08/2010 01:09 AM, Luke Palmer wrote:
On Wed, Apr 7, 2010 at 1:23 AM, Evan Laforge
wrote: Derive.PitchDeriver Derive/Derive.hs 98;" file:Cmd/Cmd.hs Derive.PitchDeriver Derive/Derive.hs 98;" file:Cmd/Play.hs Derive.PitchDeriver Derive/Derive.hs 98;" file:Cmd/ResponderSync.hs ... [ 20 more ] ...
The vim tag documentation says these are "static" tags, and implies they are meant to apply to symbols only valid within the same file, but this is clearly not the case. Actually, the vim doc implies that only "file:" is defined, and doesn't talk about "scoped tags" so I'm not sure what is going on. Anyway, whenever I go to a tag I have to first step through a message that says "1 of 25" or so. There's one for each reference in the tags file, even though those are references in other files.
Hmm odd, I don't get that behavior. Is that with the sorted annotation? What version of vim?
I get the correct behavior (no additional selection is needed). My vim version is 7.2.385. I did not use sorted annotation but I doubt it has anything to do with it.
What's going on? I even checked the current docs at vim.org and they don't mention a file:xyz form either.
I think I saw it documented *somewhere*, but now that I look again I can't find it anywhere. Maybe it was in a dream. I hope a newer version of vim didn't remove the support or something...
Even if it is not documented it makes sense. When "file:" is present then it limits the tag to the file which is the argument of "file:". If "file:" does not have any argument then the argument defaults to the file in which the tag is defined. That would mean that exported symbols should be generated without "file:", non-exported symbols should be generated with "file:" which does not have argument. In addition to this qualified symbols should be generated with the qualification and with "file:<fn>" where <fn> is the file name where the symbol is imported as qualified. Ghci's :ctags does not support qualified symbols :-/ Just to clarify it for myself. That would mean that the tags file should look like this: B.x b.hs /^x = 5 :: Int$/;" v file:a.hs B.x b.hs /^x = 5 :: Int$/;" v file:c.hs C.x c.hs /^x = B.x+1$/;" v file:a.hs localAct a.hs /^localAct = do$/;" v file: x b.hs /^x = 5 :: Int$/;" v x c.hs /^x = B.x+1$/;" v ... for these files: === file a.hs === module A () where import qualified B as B import qualified C as C localAct = do print B.x print C.x === file b.hs === module B (x) where x = 5 :: Int === file c.hs === module C (x) where import qualified B as B x = B.x+1
participants (4)
-
Erlend Hamberg
-
Evan Laforge
-
Luke Palmer
-
Peter Hercek