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 lenses that show type signatures should be inlay hints instead #3254

Open
michaelpj opened this issue Oct 6, 2022 · 2 comments
Open
Labels
status: in discussion Not actionable, because discussion is still ongoing or there's no decision yet type: enhancement New feature or request

Comments

@michaelpj
Copy link
Collaborator

Prompted by an issue with lsp-mode where they started showing code lenses at the end of the line instead of above the line by default (emacs-lsp/lsp-mode#3749). I made an issue in the spec repo (microsoft/language-server-protocol#1558) to ask whether clients can make any assumptions about where code lenses are displayed.

The answer seems to be no, we should not make assumptions about where code lenses are displayed. That means that the way we're using them to display type signatures is fundamentally unreliable. Fortunately, there is a feature that does allow specific placement of something in the buffer: inlay hints.

So I think the "right thing" here is to convert the code lenses that display type signatures into inlay hints.

@July541
Copy link
Collaborator

July541 commented Oct 22, 2022

I almost never insert the signature for instance methods really, agree to replace it with inlay hints.

@July541 July541 added status: in discussion Not actionable, because discussion is still ongoing or there's no decision yet and removed status: needs triage labels Oct 22, 2022
@michaelpj
Copy link
Collaborator Author

cc @jinser

If the argument in this ticket is correct, then maybe we should be looking at the code that currently does the type signature code lenses and figuring out how to extend it to local bindings. Then we can switch that uniformly over to use inlay hints! Note that there was some progress on that here: #2966

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: in discussion Not actionable, because discussion is still ongoing or there's no decision yet type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants