Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qualified tags should have their qualification stripped before storing them #50

Open
dmwit opened this issue May 15, 2018 · 3 comments
Open

Comments

@dmwit
Copy link

dmwit commented May 15, 2018

Currently when hasktags encounters tags with qualified names, it puts the entire qualified name in the ctags file. For example, with the following Haskell code:

type instance A B = C
type instance MC.A B = C

I get the following ctags file:

A	test.hs	1
MC.A	test.hs	2
instance	test.hs	1
instance	test.hs	2

Leaving aside the spurious tags for instance for the moment, I think the second line should have A instead of MC.A.

In case it matters (or makes things simpler somehow), I believe that type and data families are currently the only place where bindings can be qualified.

(This is a follow-on to my comments on issue #39. I initially commented there due to a misunderstanding; this is a separate issue, and that one should stay closed.)

@jhenahan
Copy link
Collaborator

Thanks for the new report! I’ll be looking into it this weekend, I hope.

@codygman
Copy link

codygman commented Oct 2, 2019

Will this affect if you have qualified imports ala elm? Like:

Import qualified Mod1 as A
import qualified Mod2 as B

And they both have:

A.get
B.get

Wouldn't retaining the qualified names be better?

@dmwit
Copy link
Author

dmwit commented Oct 2, 2019

Retaining qualified names is not better, because the qualification is only local: when viewing another module, if I see the name get, I cannot know just from that whether I should be jumping to the tag for get, A.get, or B.get. If there are three definitions of get with different qualifications, the tags file should list all three.

Of course, for a name like get this won't happen, because you currently cannot put qualified value-level names in binding position, as I mentioned in the original bug report. But the point stands anyway: local qualifications should be dropped when creating the tags file, so that there is a predictable tag to request when looking at things outside that local scope.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants