Open Kha opened 2 years ago
I wish we don't need that (e. g. there is no point for the server to send range if it is sending overlapping ranges) but you may open a pr to add a flag.
Yeah, I was wondering if our language server was going against the spec while filing this issue! But it only says "is used to visualize a hover, e.g. by changing the background color", there is no mention that it should correspond to the points where the hover is activated. I'll see when I get around to filing a PR, thanks!
I see - then we should drop the caching at all client-side. This piece of the protocol was misinterpreted.
From a quick glance at VS Code, it looks like the hover is cached there at least inside a "word". That's not supported by the spec either, but probably harmless and may make for a smoother experience while sweeping the cursor over an identifier. Which OTOH might not be as important for Emacs users if they mostly navigate word-size, e.g. via M-f/b
.
We should at least test - because blinking is also something that we want to avoid.
I have a language server (https://github.com/leanprover/lean4) that uses
Hover.range?
to highlight term structure, e.g. hovering over+
ina + b
highlights the entire term. While this works well in VS Code, in lsp-mode this unfortunately means that moving the cursor overa
will not refresh eldoc since the range of the previous hover (lsp--hover-saved-bounds
) has not been left. Could there be an option for finer grained caching of hover requests or at least a flag to disable it, somewhat likelsp-ui-sideline-update-mode
?