Skip to content

Conversation

@wz1000
Copy link
Collaborator

@wz1000wz1000 commented Jun 26, 2021

Now that we have GHC 9, it is easy to implement "Jump to instance definition" as well as show exactly
the instances being used at a point on hover.

Hover

Jump to definition

TODO

  • Extend to references - UI is a bit tricky here
  • Improve markdown rendering - @isovector did you figure out how to have inline syntax highlighting yet?
  • Fix tests
  • Clean up CPP?

@wz1000wz1000force-pushed the wip/evidence-info branch from cd9467d to dc807c4CompareJune 26, 2021 13:57
@pepeiborra
Copy link
Collaborator

pepeiborra commented Jun 26, 2021

Not strictly related to this change, but I wonder if it's possible to show the instances in scope when hovering on a type?

@isovector

This comment has been minimized.

@wz1000
Copy link
CollaboratorAuthor

Not strictly related to this change, but I wonder if it's possible to show the instances in scope when hovering on a type?

Yes it is. In fact, local completions will already (incorrectly) suggest local instances in scope (i.e. those arising from type signature contexts and case splits) if you start completing using $d.... I will fix this now.

For top level instances, we can use the same mechanism used by GHCi for :instances.

@wz1000

This comment has been minimized.

@wz1000
Copy link
CollaboratorAuthor

Some opportunities for bikeshedding:

  • We can probably do away with the top level bullet point
  • "defined using"/"constructed from"?
  • "evidence of constraint" or simply "evidence" or even "dictionary of type"?
    • Maybe omit the words "evidence of constraint" etc. from all the lower level bullet points as it is just noise at that point

@pepeiborra
Copy link
Collaborator

Some opportunities for bikeshedding:

  • We can probably do away with the top level bullet point
  • "defined using"/"constructed from"?
  • "evidence of constraint" or simply "evidence" or even "dictionary of type"?

"from instance", "via instance" or simply "instance"?

  • Maybe omit the words "evidence of constraint" etc. from all the lower level bullet points as it is just noise at that point

+1

@wz1000
Copy link
CollaboratorAuthor

"from instance", "via instance" or simply "instance"?

It is not always an instance, see for example:

2021-06-26-210629_grab

@isovector

This comment has been minimized.

@isovector

This comment has been minimized.

@pepeiborra
Copy link
Collaborator

@wz1000 are you planning to land this soon or could someone else work on it?
@July541 would you be interested in wrapping this up?

@July541
Copy link
Collaborator

It's a very practical function! I'm glad to push it far more with @wz1000' willing.

BTW, have this feature been integrated into hiedb? Call hierarchy can also jump to the corresponding instance with this.

@jneira
Copy link
Member

Needs a non trivial (for me :-P ) rebase

@wz1000
Copy link
CollaboratorAuthor

@July541 yes, feel free to pick this up. hiedb to some extent will "just work" with these changes, but it may also need some special support somewhere depending on what exactly you need to do.

@July541
Copy link
Collaborator

@wz1000 Hello, do you mind explaining some details?

  1. For Extend to references, what should it be? Should it remove irrelative instances?
  2. What should improve in markdown?

@Anton-Latukha

This comment has been minimized.

@Anton-Latukha

This comment has been minimized.

@Anton-Latukha

This comment has been minimized.

@michaelpjmichaelpj added the status: unfinished Status for PRs that have been semi-abandoned label Nov 2, 2022
@michaelpjmichaelpj mentioned this pull request Jan 7, 2024
@fendor
Copy link
Collaborator

Rebase and finished in #4392

@fendorfendor closed this Oct 23, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: unfinishedStatus for PRs that have been semi-abandoned

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants

@wz1000@pepeiborra@isovector@July541@jneira@Anton-Latukha@fendor@michaelpj