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

Display qualified type names on LSP hover #2993

Open
giacomocavalieri opened this issue Apr 16, 2024 · 2 comments
Open

Display qualified type names on LSP hover #2993

giacomocavalieri opened this issue Apr 16, 2024 · 2 comments
Labels
help wanted Contributions encouraged priority:high
Milestone

Comments

@giacomocavalieri
Copy link
Member

giacomocavalieri commented Apr 16, 2024

When you hover over a variable the LSP can show its type. In this example you can see that it shows List(Error), I think the LSP should show the Error type as qualified since it's not defined in the same module and I didn't import It qualified from the module it's defined in. So what I'd like to see here is List(rule.Error)
Not sure how feasible this is and we would probably want to make exceptions for prelude types but I think it could make the type on hover more helpful

The error type should be qualified here since I didnt import unqulified and is not defined here

@Acepie
Copy link
Contributor

Acepie commented Apr 16, 2024

Posting here for whoever works on this (I might work on this but wanna see if others have thoughts). The main difficulty with implementing this is that the types that the LSP prints are created using the same type pretty printer that the docs and error messages use. Currently that pretty printer only qualifies types if there would be a collision with an existing type that has already been printed. Making this change would require changing the behavior in a way that still lets those work the same as today (maybe by allowing the caller to pass in modules to never qualify and defaulting to qualify unless the module is explicitly excepted)

@lpil
Copy link
Member

lpil commented Apr 16, 2024

There are multiple LSP related tickets open that want a context aware printer, so making one and switching over all the LSP stuff sounds good to me.

@lpil lpil added help wanted Contributions encouraged priority:high labels Apr 16, 2024
@lpil lpil added this to the LS02 milestone May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Contributions encouraged priority:high
Projects
Status: Unfinished
Development

No branches or pull requests

3 participants