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

Add Hover information for resolved type classes #4290

Open
alanz opened this issue Jun 8, 2024 · 0 comments
Open

Add Hover information for resolved type classes #4290

alanz opened this issue Jun 8, 2024 · 0 comments
Labels
type: enhancement New feature or request

Comments

@alanz
Copy link
Collaborator

alanz commented Jun 8, 2024

The GHC AST makes liberal use of type families for Trees that Grow extension points.

When working on code that matches on a constructor, the hover information gives the type, which is as-written for the constructor, with a general parameter for the TTG extension point.

But in GHC the extension point parameter is either known precisely (e.g. GhcPs) or at least limited (GhcPass p).

Regardless, there are type family instances in the project for the given type family. These should be displayed in addition to the current hover information.

Screenshot from 2024-06-08 15-25-57

In the image, it shows hover for XExplicitTuple GhcPs. We have

type instance XExplicitTupleTy GhcPs = [AddEpAnn]

so it should in this case show [AddEpann] too.

If it had an unconstrained type parameter in the hover context, it should show all the possibilities, so given

type instance XExplicitTupleTy GhcPs = [AddEpAnn]
type instance XExplicitTupleTy GhcRn = NoExtField
type instance XExplicitTupleTy GhcTc = [Kind]

It should represent this somehow, perhaps just showing the instances in the hover.

For bonus points, have "go to type definition" go to the appropriate definition (or list of definitions)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

2 participants