Closed elextr closed 9 months ago
When the cursor is moved off any code a hover popup shows for line 1.
I hope it's fixed now - I didn't see exactly this but I can imagine it could happen. See the commit message for more details.
This isn't my favorite feature (at least in the annoying hover mode) so I didn't test it much. Please report other problems when you run into something.
Yep, appears to be fixed.
On the same topic (annoying hovers) is there any control of the verbosity of the messages? Or maybe we only show the type field, getting five line popups all the time is also annoying as you found I guess :-).
On the same variable it
in the same file Vscode shows std::vector<Foo>::iterator it
while the type field from clangd shows iterator (aka __normal_iterator<Foo *, std::vector<Foo, std::allocator<Foo>>>)
.
Note this is an inferred type, I didn't type either of them, thats why we need hover (as I explained in my last answer to Kugel, see that for more detail). The Vscode one is sufficiently detailed but the clangd one is too brief and the "aka" part shows implementation details that we don't care about. Can clangd be configured to produce the goldilocks result?
On the same topic (annoying hovers) is there any control of the verbosity of the messages? Or maybe we only show the type field, getting five line popups all the time is also annoying as you found I guess :-).
You can only configure the returned string kind from the server - it can either be plaintext or markdown. I use the plaintext version.
In the clangd config file you should be able to configure the aka, but that's all I found:
Alright, I just found this:
https://clangd.llvm.org/extensions
There are some clangd-specific LSP calls we could probably use and get some extra info but at least for now I'd stick to the standard ones.
@elextr Do you know if the Microsoft vscode extension actually uses clangd? I tried the "official" clangd extension and it behaves much more like what Geany does now.
There are some clangd-specific LSP calls we could probably use and get some extra info but at least for now I'd stick to the standard ones.
Probably why Vscode has a per-language LSP extension, not one for all languages, it can then use specific APIs.
Do you know if the Microsoft vscode extension actually uses clangd?
I don't think so, certainly there is no clangd process running and all the extensions I have are labelled Microsoft. I think its their own intellisense server from visual studio (IIUC).
On the same variable it in the same file Vscode shows
std::vector<Foo>::iterator
it while the type field from clangd showsiterator (aka __normal_iterator<Foo *, std::vector<Foo, std::allocator<Foo>>>)
.Note this is an inferred type, I didn't type either of them, thats why we need hover (as I explained in my last answer to Kugel, see that for more detail). The Vscode one is sufficiently detailed but the clangd one is too brief and the "aka" part shows implementation details that we don't care about. Can clangd be configured to produce the goldilocks result?
I don't know where Vscode gets the std::vector<Foo>::iterator
from, if I goto type definition
on it
it goes to the line containing the aka shown by clangd. So it seems Vscode might synthesise a human friendly version, so maybe there is nothing we can do for the moment.
@elextr Thanks.
I'm closing this PR as the OP is fixed hopefully.
When the cursor is moved off any code a hover popup shows for line 1.
Since it also shows over windows which cover Geany its very annoying, move the cursor off Geany to the browser to write this and the browser covers geany but the line 1 popup shows on top of the browser.
Maybe Scintilla can be used to tell the cursor is not in code and so the hover not be shown.