-
Notifications
You must be signed in to change notification settings - Fork 200
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
eglot only shows documentation for the function call under the cursor #1171
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. |
Yep, also #1031 |
Does |
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 |
But that change, if it happens, is probably not going to be so sudden. |
I think |
This change addresses the problems reported in many Elglot reports dating back to early 2021 at least: joaotavora/eglot#648 joaotavora/eglot#894 joaotavora/eglot#920 joaotavora/eglot#1031 joaotavora/eglot#1171 In one form or another, the reports point out that the multiple pieces of information about the "thing at point" made available by the LSP server are not all being considered by the ElDoc system. The reason for this is Eglot setting/trampling the variables 'eldoc-documentation-strategy' and 'eldoc-documentation-functions' in its minor more entry function. The reason it did that is historical and is partially described in the issues above. But, evidently, it never made much sense, because so many people want to override it, which requires setting 'eldoc-documentation-strategy' to the non-default value 'eldoc-documentation-compose'. The problem was made worse by the fact that setting it as usual in either the Customize menu or their init file didn't work, requiring a fairly complex Elisp snippet. That is now solved as of this commit. If the user does not do any setting, then Eglot works basically the same as before (i.e. shows only one piece of information). It is arguable that the default value for 'eldoc-documentation-strategy' should change globally to 'eldoc-documentation-compose', but that has other subtle implications and is not part of this commit. * lisp/progmodes/eglot.el (eglot--managed-mode): Don't set Eldoc variables greedily.
@joaotavora Thanks for the solution, everything works now! |
Thanks. By the way, this should have been a discussion, not an issue report. Moving to discussion. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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.The text was updated successfully, but these errors were encountered: