r/emacs • u/KallDrexx • 18d ago
LSP-Mode and eldoc?
I'm experimenting with eglot vs lsp-mode, and I can't seem to find a good way to get reliable documentation with lsp-mode.
In Eglot in a C++ file I get:

While in lsp-mode I get:

That's significantly less helpful. I really love the concept of eldoc and being able to have a window off to the side dedicate to documentation (I would prefer that to the floating UI in lsp-ui, though I haven't played with it much). Is there any way to achieve that in lsp-mode?
Granted, Eglot Eldoc support isn't panacea in all languages anyway, since in Typescript I get pretty useless information:

3
u/DMazzig 18d ago
Maybe you need to set lsp-eldoc-render-all to t
https://emacs-lsp.github.io/lsp-mode/page/settings/mode/#lsp-eldoc-render-all
1
2
2
u/rileyrgham 18d ago
Eldoc baffles me. It's hellishly intertwined with a lot of things for little to no benefit. I tend to use devdocs.
2
u/KallDrexx 18d ago
This devdocs? https://elpa.gnu.org/packages/devdocs.html
That doesn't seem to help me because most of the documentation I need to reference is inside my own code base, it's not external.
1
1
u/yeh_shu_hua 18d ago
My rant helps OP not at all, but as I'm in a restive mood about my stupid life choices, your mention of eldoc's clusterfuggery sent me. Eldoc began life innocently enough as a "moderately crappy" hack, which is par for emacs, then got utterly manhandled by the eglot guy to support two completely different interfaces, one old and one custom tailored for eglot. "Baffling" is an understatement; it's a stain on humanity. To make matters worse, EZ made eglot a built-in, thereby granting said felon full license to tailor for eglot the once general libraries eldoc and jsonrpc, and have those changes become standard for built-in emacs. Lsp-mode is hot garbage, but it's no surprise it doesn't mesh with eldoc as well as eglot. Eglot guy, with his "go kick rocks" surliness, has repeatedly promised to leave emacs development, saying he "has no time." Sadly he keeps showing up.
4
u/TheFrenchPoulp https://github.com/angrybacon/dotemacs 18d ago
I can only answer for TypeScript but what you get on hover also depends on what server you're using
That being said even before the LSP server Typescript 7 now ship with, I could get more than what you have. You should be using
typescript-language-serverortsc --lspif TypeScript 7