eglot only shows documentation for the function call under the cursor #1173
Replies: 9 comments
-
This is a known problem that I've been trying to solve, but it's not incredibly easy (although it looks easy) For now, you can do this workaround. (add-hook 'eglot-managed-mode-hook
(lambda () (setq eldoc-documentation-strategy
#'eldoc-documentation-compose)) It should do what you want. It's possible or even likely that, if you're into having all possible information at point be available through ElDoc, you also want (add-hook 'eglot-managed-mode-hook
(lambda () (setq eldoc-documentation-functions
'(flymake-eldoc-function
eglot-signature-eldoc-function
eglot-hover-eldoc-function)))) Then if you happen to have some syntax error or diagnostic at point, that information will also be displayed in Eldoc outlets. The thing is, I want you and many others to not need this workaround anymore. This But if we make it the default, it has subtle implications in This will take some discussion in the Emacs bug tracker, probably. But I think I can do part of this change soon anyway. |
Beta Was this translation helpful? Give feedback.
-
Yep, also #1031 |
Beta Was this translation helpful? Give feedback.
-
Does |
Beta Was this translation helpful? Give feedback.
-
Yes it is, because eglot sets it buffer-locally. Go ahead and test. But I'm about to change that, so that that very line in the init file will be enough. Then I will argue in emacs-devel or bug-gnu-emacs that the global default for |
Beta Was this translation helpful? Give feedback.
-
But that change, if it happens, is probably not going to be so sudden. |
Beta Was this translation helpful? Give feedback.
-
I think |
Beta Was this translation helpful? Give feedback.
-
@joaotavora Thanks for the solution, everything works now! |
Beta Was this translation helpful? Give feedback.
-
Thanks. By the way, this should have been a discussion, not an issue report. Moving to discussion. |
Beta Was this translation helpful? Give feedback.
-
I am using eglot that came with my emacs build (
GNU Emacs 29.0.60 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.35, cairo version 1.17.6) of 2023-02-03
).I believe it should contain the last stable version of eglot.
My issue is that when I try to lookup documentation for a variable which is used as a function argument I only get documentation for that function. Doesn't matter if I just hover over it with my cursor or press the
eglot-doc-buffer
keybind.So if I ever want to look at the variable(or even like an enum value, etc), I must copy its name and paste it somewhere else before I can see its docs.
Like this:
And I checked if
lsp-mode
can achieve what I want, and it can. So its not impossible.Beta Was this translation helpful? Give feedback.
All reactions