MarcWeber / hasktags

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

type and data families aren't handled well #51

Open dmwit opened 6 years ago

dmwit commented 6 years ago

For the following Haskell file:

type family A
type instance B = C
data family D
data instance E = F

class G a where
    type H a
    data I a

instance J a where
    type K a = L
    data M a = N

I expect to find tags for A, B, D, E, F, G, H, I, J, K, M, and N (but not C or L). This is what I actually get:

B   test.hs 2
F   test.hs 4
G   test.hs 6
G   test.hs 6
H   test.hs 7
I   test.hs 8
family  test.hs 1
family  test.hs 3
instance    test.hs 2
instance    test.hs 4
instance    test.hs 10
jhenahan commented 6 years ago

Type families are utterly unsupported at the moment, but I’m hoping to revamp the current parsing code, which should give a little more flexibility for dealing with these. I’m fairly sure it just gives up after the word type, so I’ll have to add a case to handle the extra stuff.

Related: if I get around to playing with the GHC lexer, a version supporting only >8.4 should support these pretty immediately.