techee / geany-lsp

LSP plugin for the Geany editor
GNU General Public License v2.0
11 stars 1 forks source link

Hover popup annoyance #13

Closed elextr closed 9 months ago

elextr commented 9 months ago

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.

techee commented 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.

elextr commented 9 months ago

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?

techee commented 9 months ago

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:

https://clangd.llvm.org/config#showaka

techee commented 9 months ago

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.

techee commented 9 months ago

@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.

elextr commented 9 months ago

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).

elextr commented 9 months ago

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?

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.

techee commented 9 months ago

@elextr Thanks.

I'm closing this PR as the OP is fixed hopefully.