zls icon indicating copy to clipboard operation
zls copied to clipboard

investigate proposed VS Code API for hover verbosity level

Open Techatrix opened this issue 8 months ago • 0 comments

VS Code has an API proposal that adds the ability to request more or less information to be displayed in a hover popup. We should keep an eye on it and hope it is accepted and put into the LSP specification.

It can be used to provide these features (and many more):

  • peek into the function body when hovering over a function
  • show fields on function declarations when hovering over a container type
  • show size/alignment of types. See https://github.com/zigtools/zls/issues/1677
  • hide the Goto ... list when hovering over a function
  • show all possible returned errors when hovering over a function

Fortunately, nothing is stopping us from adding it to ZLS anyway to experiment with it.

Here is a small demonstration of how this could look like:

https://github.com/user-attachments/assets/4ef7cfc8-8e69-4b73-bccf-520e05ad4297

Techatrix avatar May 13 '25 21:05 Techatrix