emacs-lsp / lsp-ui

UI integrations for lsp-mode
https://emacs-lsp.github.io/lsp-ui
GNU General Public License v3.0
1.03k stars 141 forks source link

`lsp-ui-doc-show` broken #709

Closed erikarvstedt closed 2 years ago

erikarvstedt commented 2 years ago

Since commit bc05895033b80b79dce179e56b04289ff29abef4 (#696), lsp-ui-doc-show doesn't show a doc popup anymore, only mode-line documentation is shown.

I've reproduced this with a minimal Emacs config:

jcs090218 commented 2 years ago

Let me revert this. See #710.

Lenbok commented 2 years ago

OK I see - it's actually auto-hiding during post-command hook evaluation, but since lsp-ui-doc calls lsp-ui-doc--callback synchronously it's effectively happening immediately. Whereas lsp-ui-doc--mouse-display, and lsp-ui-doc--make-request (as used by both cursor and glance) all end up calling lsp-ui-doc--callback via an asynchronous request, which means the hiding happens on the next command. (Still a bug though, since when you call lsp-ui-doc-show it shouldn't auto-hide at all)

The code seems a bit of a mess / inconsistent to me. There seems no good reason why lsp-ui-doc-show should be synchronous while the others are asynchronous, and lsp-ui-doc-glance should be treated the same as lsp-ui-doc-show but with the addition of auto-hide. I'll make another PR.

Lenbok commented 2 years ago

Opened #711

Both lsp-ui-doc-show and lsp-ui-doc-glance work fine with it for me.