emacs-lsp / lsp-ui

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

Long text in lsp-ui-doc boxes can hang emacs and is unreadable in the minibuffer with eldoc-enable-hover #692

Open fhars opened 2 years ago

fhars commented 2 years ago

If the displayed text (like the doc comment for the cortex_m_rt crate) is longer than the box used by lsp-ui-doc, it is impossible to read most of it.

You can hover over a symbol, then the box with the beginnig of the text opens. You can move the mouse cursor into the box and then scroll down two or three lines, but then nothing more happens. Once you move the mouse cursor out of the box, you get something like this in the *Messages*buffer:

Args out of range: 503, 503 [45271 times]

If the box was opened because of lsp-ui-doc-show-with-cursor and you then move the mouse pointer into the box and scroll down a line, emacs becomes completely unresponsive.

If you have eldoc-enable-hover activated, the minibuffer will usually display a few lines from somewhere in the middle of such a text, but not always the same.

lsp-ui: 20220311.1634, lsp-mode: 20220401.1003, GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.14) of 2020-03-26, modified by Debian (Ubuntu 20.04)

deifactor commented 1 year ago

In my brief testing, eldoc-box works fine with this sort of thing. I have lsp-eldoc-render-all set to t (you'll probably want to either disable eldoc-mode in lsp-mode buffers or set eldoc-echo-area-use-multiline-p to something small), and an lsp-mode hook to enable `eldoc-box-hover-mode. I was able to scroll a long docstring just fine, even with the doc frame height set to something silly like 30.

So lsp-ui-doc must be doing something eldoc-box isn't.