-
Notifications
You must be signed in to change notification settings - Fork 257
Explore providing secondary labels and errors/notes using textDocument/hover instead #662
Comments
I prefer using hover for the secondary diagnostic info - the problem with merging is that VSCode does no formatting, line-breaking, or overflow handling, so the info disappears off the side of the window and is unreadable (although iirc, it looks OK on hover, it's just the problem window which is annoying). By doing the hover stuff ourselves, we should also be able to handle multiple spans nicely. |
I started looking at this yesterday before you raised this, great minds huh? #664 |
@alexheretic did you make any headway on this? @Xanewok created this issue after me trying to find some work to do on IRC :) But if you're making good progress, I'll look elsewhere for stuff to do. Maybe you can raise a PR to show progress? |
Cool. Thanks! |
@algesten hey, sorry it turned out like this - didn't want to specifically mention you not to make you feel pressured or obliged to do it! |
@Xanewok no worries. There are other things I can do. :) |
For now we present this all in a single diagnostics message (#664 has more shots how it currently looks like), but it'd still be good to see how it looks like when providing secondary diagnostics on a textDocument/hover, instead of merging this in one message. One benefit is that hover supports Markdown and so we could provide faimiliar rustc formatting (bolding, code backticks). However, one thing to keep in mind are terminal editor users. If only diagnostic messages are displayed inline in those, It might not be a good idea to take secondary span labels away from the message itself and move it to hover and only do that for notes/hints. @autozimu wrt the above, how do you think the secondary diagnostic should look like in Vim and similar? |
The extra formatted message would be really helpful. But is it possible to have those messages in both published diagnostics and hover response? For current vim/neovim, when a user navigate to a specific line, the cached diagnostic will be displayed (though extra work to be done under autozimu/LanguageClient-neovim#224), but currently hover would require an explicly action from user and takes a round trip to language server. |
I don't think this is possible, since the client would display the 'extended' bit of the error twice when hovering. |
One obvious use case is for
mismatched types
error now: #550. Since we don't include the information from secondary diagnostic (expected <type>, found <another>
) in the published IDE diagnostics, users are not informed why exactly is there an error and how to fix it.iirc @nrc also suggested that we may additionally include the secondary diagnostics info as a response to textDocument/hover.
The text was updated successfully, but these errors were encountered: