With Clojuredocs examples on, you have to scroll to the bottom of the hover to see problem reports
Slack thread: https://clojurians.slack.com/archives/CBE668G4R/p1670838574590269
In https://github.com/BetterThanTomorrow/calva/issues/1998, I found that no API exists to move the problems report above the hover provider-provided text in the hover pane. However, having to scroll to the bottom of the hover to see problems is pretty annoying, and it appears that most other language extensions seem like they keep their hover texts short enough to not require scrolling precisely for this reason.
Perhaps it'd be worth considering moving the Clojuredocs examples somewhere else, like the "advanced hover" (when you hold down cmd or alt I think?) or in a pane to the side, or somewhere else entirely.
One way to deal with this is to use Joyride to provide an extra diagnostics hover item at the top of the hover. I made an example for this here:
https://github.com/BetterThanTomorrow/joyride/blob/master/examples/.joyride/src/problem_hover.cljs
I've now experimented a bit with hovers and it seems all things I try first seem to work, but then they don't. My latest attempt was to stick the docs under a details/summary thing. Which works, but then doesn't work well enough to be useful:
- https://github.com/microsoft/vscode-discussions/discussions/339
I also have tried to make a command link that would be there instead of the ClojureDocs info and when clicked will show the hovers. The problem with this is that there is no API for re-rerendering the hover. We can execute a command to show it, but it will show the hover for whatever the text cursor is at. I checked the source for this command and this is how it is supposed to work so we can't provide arguments to the command to make it show a particular hover.
For historical reference, here's where we discussed options for where/how to show the clojuredocs material in the past: https://github.com/BetterThanTomorrow/calva/issues/689.
I'd prefer we move them out of the hover and use a webview to avoid any issues with hovers. Webviews that are read-only will be much less troublesome for this than using hovers, I think. Clojure-lsp may put them in the hover, but that doesn't mean we need to stick with that just for consistency, and maybe it would be better if clojure-lsp didn't do that anyway.
That's where my mind is currently. I think the benefit of having them in the hover, some might say, is to have less friction/interruption in the user's workflow, but the costs may outweigh that benefit, and for me personally, considering how rarely I use the clojuredocs material in the hover, I'd rather open it up in a separate pane only when I want to see it. Since we've tried the hover approach already and have heard multiple users mention this issue, maybe now we can try another approach.
I like the idea of moving the docs out of the hover. I am currently using the Docs View Plugin to display them in a separate window and make them scrollable by keyboard. Would be nice to show only the error and maybe the parameters of the function on hover imo.