-
Notifications
You must be signed in to change notification settings - Fork 837
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
offer more configuration for textDocument/hover #772
Comments
To stay in line with other request we should improve this in the following way:
I am open to such a improvement. However it needs to be speced and we need to have a reference implementation for it. |
This feature would also help for |
To add a bit more to this issue - golang/go#33352 was just raised in |
@dbaeumer: Just to clarify, would I be able to contribute the solution for this issue, or would it have to be someone who works on the LSP? |
@stamblerre sorry for the late reply. Yes, I would accept a PR for this. However as state we need a reference implementation for it in one of the editors / tools. It can't only be a spec update. |
Many LSP servers, like gopls, return `document/onHover` as MarkupContent. This modifies the eldoc behavior to support MarkupContent by displaying the first rendered line. As the majority of LSP servers return the signature, this will display the signature as most people expect. In the future, microsoft/language-server-protocol#772 should make this more reliable.
* Display the first line of MarkupContent in eldoc Many LSP servers, like gopls, return `document/onHover` as MarkupContent. This modifies the eldoc behavior to support MarkupContent by displaying the first rendered line. As the majority of LSP servers return the signature, this will display the signature as most people expect. In the future, microsoft/language-server-protocol#772 should make this more reliable. * nit: use s-lines
My use case for a hover extension is that often for a particular position I have different infos corresponding to different ranges under the position. I understand this would cover my case of returning multiple pairs of hover info + range. |
Because the hover result is either a string or a markdown string, it's hard to offer users more configuration over their hover results.
A good example of this is this issue raised against
gopls
: golang/go#32561. Some users want to see full documentation on hover, while others prefer to see one sentence of the documentation, while others may prefer to see none at all.Personally, my preferred solution would be to offer users a "see more" option, something like holding down Command and hovering over an identifier. Right now, that just previews the declaration of the identifier, but perhaps it could be something like a detailed hover?
Is there any chance that the
textDocument/hover
could have adetailed
configuration, or maybe there could be an additionaltextDocument/detailedHover
? I would suspect that most languages return some combination of documentation and signatures/type declarations, so maybe hover could even be more structured than just a string?Otherwise, I will likely add additional configurations to
gopls
to control the level of hover. I figured it was worth raising this issue because I suspect other languages would encounter these questions as well.The text was updated successfully, but these errors were encountered: