MarcWeber / hasktags

Produces ctags "tags" and etags "TAGS" files for Haskell programs
Other
131 stars 33 forks source link

Infix functions not treated correctly #9

Closed adimit closed 6 years ago

adimit commented 9 years ago

Functions defined as operators are not caught correctly.

(-:) = undefined
(->>) = undefined

Should define two infix functions -: and ->>, but hasktags only records a single entry of the name ( with the correct line number of the first such defined function in a file.

adimit commented 9 years ago

Additionally, infix functions defined with arguments (as opposed to the pointfree style above) are also not recognized, and the name of the first variable binding is chosen to represent the function's name in the tags file.

k -:> f = undefined
k -+> f = undefined

Will result in a single entry k at the line number for the first of the two entries (expected entries -:>, and -+>.)

heroin-moose commented 6 years ago

I can confirm that this issue is still there.

jhenahan commented 6 years ago

Just started a new job that leaves me with way more cycles for working on open source, so I'll be looking into these longstanding issues ASAP. Thanks for the ping.

jhenahan commented 6 years ago

The first half of this issue is now fixed. Pointfree operator definitions are now tagged properly. Definitions with arguments can be tagged properly, but only with an accompanying type definition. Without getting into some really gross heuristics, I'm not sure that I can devise a method to tag such definitions with the codebase as-is. I'm looking into using the lexer exposed for more recent GHCs to try to support this usecase, though. Feel free to reopen if this is unsatisfactory and you've got an idea.