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

Code lens to display type signature for local bindings in where clauses #2943

Open
July541 opened this issue Jun 7, 2022 · 10 comments · May be fixed by #2966
Open

Code lens to display type signature for local bindings in where clauses #2943

July541 opened this issue Jun 7, 2022 · 10 comments · May be fixed by #2966
Assignees

Comments

@July541
Copy link
Collaborator

July541 commented Jun 7, 2022

Reminded by #2019 (comment), I think it would be great to have a configurable plugin to display a signature code lens for local bindings in where clauses.

Please let me know if there has more places need code lenses.

Edited: I'll try to pick bindings from RenamedSource, please let me know if there is a more efficient way. Should be TypeCheckedSource.

@July541 July541 self-assigned this Jun 7, 2022
@July541 July541 changed the title Code lens to display type signature for local bindings Code lens to display type signature for local bindings in where clauses Jun 7, 2022
@michaelpj
Copy link
Collaborator

configurable

Configuration is bad! I say have it be enabled whenever the main type signature lens is.

@July541
Copy link
Collaborator Author

July541 commented Jun 7, 2022

Configuration is bad! I say have it be enabled whenever the main type signature lens is.

Could you please explain why configuration is bad? Ideally I want to control everything displayed on my screen by category...

@michaelpj
Copy link
Collaborator

Because it means more things for users to think about, a bigger settings page, and more things for us to support. I think if we can, it's best only to introduce configuration in cases where there's a real split in what people want and people are annoyed if they don't get the one they want.

@July541
Copy link
Collaborator Author

July541 commented Jun 7, 2022

So, we can implement this feature into ghcide?

@michaelpj
Copy link
Collaborator

I think that's reasonable. Especially since I'd hope the code is mostly there already!

@uhbif19
Copy link
Collaborator

uhbif19 commented Jun 16, 2022

Does not it already show type signatures?

image

@July541
Copy link
Collaborator Author

July541 commented Jun 17, 2022

Does not it already show type signatures?

Yes, but it requires users hover on it, I'm going to display code lens directly like this:

image

@uhbif19
Copy link
Collaborator

uhbif19 commented Jun 17, 2022

@July541 Now I got it, I misunderstood that "code lens" is, I thought lens is a bubble.

That is cool. But why this issue is concerned only on where clauses? Should be cool to see this in let clauses too. Now I do not get them.

image

@July541
Copy link
Collaborator Author

July541 commented Jun 19, 2022

I initially want to display sigs for let bindings by inlay hints, see #2938, but now I think it's not bad to show code lens too, maybe it is worth trying after #2966 :)

@michaelpj
Copy link
Collaborator

I think doing a code lens is good: code lenses fit better for places where you can put signatures on their own lines, which is probably better in general.

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

Successfully merging a pull request may close this issue.

3 participants