microsoft/language-server-protocol

offer more configuration for textDocument/hover

Aperta

#772 aperta il 12 giu 2019

 (6 commenti) (2 reazioni) (0 assegnatari)HTML (956 fork)batch import
feature-requesthelp wantedhover

Metriche repository

Star
 (12.810 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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: https://github.com/golang/go/issues/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 a detailed configuration, or maybe there could be an additional textDocument/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.

Guida contributor