-
Notifications
You must be signed in to change notification settings - Fork 200
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
Hover vs. diagnostics (C-h .) #454
Comments
On Mon, May 4, 2020, 07:08 Felicián Németh ***@***.***> wrote:
possible to prioritize the diagnostics info and only show the
documentation when, for example, C-h . is invoked with a prefix argument?
Maybe the priorities could be inverted (diags before docs). Or show both in
the
help buffer. Or give up on this idea entirely, since keybindings isn't
usually Eglot's business.
João
João
|
Theoretically there can be other sources producing local help besides Eglot/Flymake, so the first two alternatives are tricky to implement. At least, I don't know how to do it cleanly. The easiest would be to remove the keybinding, but a convenient combination of the diagnostics and the documentation does sound appealing. |
That's why we fetch them with |
Commit a0249c8 remapped display-local-help to eglot-help-at-point. This commit restores the old behaviour when both diagnostics and hover information are available, i.e., it shows the diagnostics information. * eglot.el (eglot-help-at-point): Prioritize local-help over hover info.
Following your suggestion I've created a pull request for this. However, if there are no diags, we might get something like this as an eldoc message: |
I'm also in favour of doing further work in this area. I don't mind what decisions are taken regarding keybindings, but how about the following approach:
In case it's helpful, here (from #481) are some screenshots of displaying compiler errors along with documentation:
|
For |
Dmitry Gutov <notifications@github.com> writes:
For eglot-help-at-point, I like C-c C-d, SLIME-style.
As far as I know, C-c C-d is a prefix to lots of stuff in SLIME.
Did you mean?
C-c C-d d slime-describe-symbol
Anyway, that doesn't describe the compilation error at point, if there
is one.
|
I suppose. If Eglot is going to have multiple commands, to show docs for different "things" at point. But it probably won't.
Indeed. And I'd rather not mix these things. |
Well, it seems to be the opinion of some actual users of Eglot (including myself) that there should be some tool to display information available in a given point context, which would include diagnostics and summarized documentation. That can be done either via eldoc or via |
Anyway, as I said, my point is really not to introduce new bindings in Eglot. Users or third party packages, including daemonic distributions 😈 , that depend on Eglot can provide all the keybindings they want, though. So I think this should really work with the existing tooling offered by of
|
Yes, okay. But what about long-ish documentation for functions? Not one-liner summaries. Doesn't Eglot have a feature like that? |
Yes, though it's complicated. Many issues about it. There a custom variable for that |
Hmm. I'll have to try it. But so far I have to say I liked the distinction between automatic one-lines being shown somewhere in the echo area, and long-form documentation displayed when I invoke some command manually. And eldoc-box and similar approaches won't work in terminal (among other considerations), so I'm not sure we can standardize on this approach. |
Sure, but that command belongs in
Agree with the first part, but the second part, "standarddize" , is whatever is more sensible. Like |
Why not. It could use an extension point, and a standard keybinding would be welcome. |
What is the current workaround for this? I've been using This? : (define-key eglot-mode-map [remap display-local-help] nil) |
I'm using this: (customize-set-variable 'help-at-pt-display-when-idle t) When the hover info is shown, I can press It would be great to be able to cycle through all available messages in the echo area. |
Yes, this should work.
This is clearly suboptimal. As some of you know, I'm working on fixing this correctly in Emacs's own
That's interesting functionality, but I think it should be made a part of either |
Absolutely agree. |
Uses Eldoc's eldoc-documentation-functions variable. In Eldoc v1.0.0 that variable was already available as a way of handling/composing multiple docstrings from different sources, but it didn't work practically with mutiple concurrent async sources. This was fixed in 1.1.0, which Eglot now requires. This fixes the synchronization problems reported in #494 and also issue #439. It is likely that some of the exact doc-composing functionality in Eglot, (developed during those issues) was lost, and has to be remade, quite likely in Eldoc itself. Flymake is now also an Eldoc producer, and therefore the problems of github issues #481 and #454 will also soon be fixed as soon as Eglot starts using the upcoming Flymake 1.0.9. * NEWS.md: New entry. * README.md (eglot-put-doc-in-help-buffer) (eglot-auto-display-help-buffer): Remove mention to these options. * eglot.el (Package-Requires:) Require eldoc.el 1.1.0. (eglot--when-live-buffer): Rename from eglot--with-live-buffer. (eglot--when-buffer-window): New macro. (eglot--after-change, eglot--on-shutdown, eglot-ensure): Use eglot--when-live-buffer. (eglot--managed-mode): Use eglot-documentation-functions and eldoc-documentation-strategy. (eglot--highlights): Move down. (eglot-signature-eldoc-function, eglot-hover-eldoc-function) (eglot--highlight-piggyback): New eldoc functions. (eglot--help-buffer, eglot--update-doc) (eglot-auto-display-help-buffer, eglot-put-doc-in-help-buffer) (eglot--truncate-string, eglot-doc-too-large-for-echo-area) (eglot-help-at-point): Remove all of this. (eglot--apply-workspace-edit): Call eldoc manually after an edit. (eglot-mode-map): Remap display-local-help to eldoc-doc-buffer
The new, enhanced eldoc package solves the original issue, so I'm closing it. |
Hey @nemethf , welcome back. If you could find and fix the related issue here about the out-of-date README.md doc that still talks about eglot-help-at-point, it would be icing on the cake ;-) |
Uses Eldoc's eldoc-documentation-functions variable. In Eldoc v1.0.0 that variable was already available as a way of handling/composing multiple docstrings from different sources, but it didn't work practically with mutiple concurrent async sources. This was fixed in 1.1.0, which Eglot now requires. This fixes the synchronization problems reported in joaotavora/eglot#494 and also issue joaotavora/eglot#439. It is likely that some of the exact doc-composing functionality in Eglot, (developed during those issues) was lost, and has to be remade, quite likely in Eldoc itself. Flymake is now also an Eldoc producer, and therefore the problems of github issues joaotavora/eglot#481 and joaotavora/eglot#454 will also soon be fixed as soon as Eglot starts using the upcoming Flymake 1.0.9. * NEWS.md: New entry. * README.md (eglot-put-doc-in-help-buffer) (eglot-auto-display-help-buffer): Remove mention to these options. * eglot.el (Package-Requires:) Require eldoc.el 1.1.0. (eglot--when-live-buffer): Rename from eglot--with-live-buffer. (eglot--when-buffer-window): New macro. (eglot--after-change, eglot--on-shutdown, eglot-ensure): Use eglot--when-live-buffer. (eglot--managed-mode): Use eglot-documentation-functions and eldoc-documentation-strategy. (eglot--highlights): Move down. (eglot-signature-eldoc-function, eglot-hover-eldoc-function) (eglot--highlight-piggyback): New eldoc functions. (eglot--help-buffer, eglot--update-doc) (eglot-auto-display-help-buffer, eglot-put-doc-in-help-buffer) (eglot--truncate-string, eglot-doc-too-large-for-echo-area) (eglot-help-at-point): Remove all of this. (eglot--apply-workspace-edit): Call eldoc manually after an edit. (eglot-mode-map): Remap display-local-help to eldoc-doc-buffer
Uses Eldoc's eldoc-documentation-functions variable. In Eldoc v1.0.0 that variable was already available as a way of handling/composing multiple docstrings from different sources, but it didn't work practically with mutiple concurrent async sources. This was fixed in 1.1.0, which Eglot now requires. This fixes the synchronization problems reported in joaotavora/eglot#494 and also issue joaotavora/eglot#439. It is likely that some of the exact doc-composing functionality in Eglot, (developed during those issues) was lost, and has to be remade, quite likely in Eldoc itself. Flymake is now also an Eldoc producer, and therefore the problems of github issues joaotavora/eglot#481 and joaotavora/eglot#454 will also soon be fixed as soon as Eglot starts using the upcoming Flymake 1.0.9. * NEWS.md: New entry. * README.md (eglot-put-doc-in-help-buffer) (eglot-auto-display-help-buffer): Remove mention to these options. * eglot.el (Package-Requires:) Require eldoc.el 1.1.0. (eglot--when-live-buffer): Rename from eglot--with-live-buffer. (eglot--when-buffer-window): New macro. (eglot--after-change, eglot--on-shutdown, eglot-ensure): Use eglot--when-live-buffer. (eglot--managed-mode): Use eglot-documentation-functions and eldoc-documentation-strategy. (eglot--highlights): Move down. (eglot-signature-eldoc-function, eglot-hover-eldoc-function) (eglot--highlight-piggyback): New eldoc functions. (eglot--help-buffer, eglot--update-doc) (eglot-auto-display-help-buffer, eglot-put-doc-in-help-buffer) (eglot--truncate-string, eglot-doc-too-large-for-echo-area) (eglot-help-at-point): Remove all of this. (eglot--apply-workspace-edit): Call eldoc manually after an edit. (eglot-mode-map): Remap display-local-help to eldoc-doc-buffer
Uses Eldoc's eldoc-documentation-functions variable. In Eldoc v1.0.0 that variable was already available as a way of handling/composing multiple docstrings from different sources, but it didn't work practically with mutiple concurrent async sources. This was fixed in 1.1.0, which Eglot now requires. This fixes the synchronization problems reported in #494 and also issue #439. It is likely that some of the exact doc-composing functionality in Eglot, (developed during those issues) was lost, and has to be remade, quite likely in Eldoc itself. Flymake is now also an Eldoc producer, and therefore the problems of github issues #481 and #454 will also soon be fixed as soon as Eglot starts using the upcoming Flymake 1.0.9. * NEWS.md: New entry. * README.md (eglot-put-doc-in-help-buffer) (eglot-auto-display-help-buffer): Remove mention to these options. * eglot.el (Package-Requires:) Require eldoc.el 1.1.0. (eglot--when-live-buffer): Rename from eglot--with-live-buffer. (eglot--when-buffer-window): New macro. (eglot--after-change, eglot--on-shutdown, eglot-ensure): Use eglot--when-live-buffer. (eglot--managed-mode): Use eglot-documentation-functions and eldoc-documentation-strategy. (eglot--highlights): Move down. (eglot-signature-eldoc-function, eglot-hover-eldoc-function) (eglot--highlight-piggyback): New eldoc functions. (eglot--help-buffer, eglot--update-doc) (eglot-auto-display-help-buffer, eglot-put-doc-in-help-buffer) (eglot--truncate-string, eglot-doc-too-large-for-echo-area) (eglot-help-at-point): Remove all of this. (eglot--apply-workspace-edit): Call eldoc manually after an edit. (eglot-mode-map): Remap display-local-help to eldoc-doc-buffer #494: joaotavora/eglot#494 #439: joaotavora/eglot#439 #481: joaotavora/eglot#481 #454: joaotavora/eglot#454
Uses Eldoc's eldoc-documentation-functions variable. In Eldoc v1.0.0 that variable was already available as a way of handling/composing multiple docstrings from different sources, but it didn't work practically with mutiple concurrent async sources. This was fixed in 1.1.0, which Eglot now requires. This fixes the synchronization problems reported in joaotavora/eglot#494 and also issue joaotavora/eglot#439. It is likely that some of the exact doc-composing functionality in Eglot, (developed during those issues) was lost, and has to be remade, quite likely in Eldoc itself. Flymake is now also an Eldoc producer, and therefore the problems of github issues joaotavora/eglot#481 and joaotavora/eglot#454 will also soon be fixed as soon as Eglot starts using the upcoming Flymake 1.0.9. * NEWS.md: New entry. * README.md (eglot-put-doc-in-help-buffer) (eglot-auto-display-help-buffer): Remove mention to these options. * eglot.el (Package-Requires:) Require eldoc.el 1.1.0. (eglot--when-live-buffer): Rename from eglot--with-live-buffer. (eglot--when-buffer-window): New macro. (eglot--after-change, eglot--on-shutdown, eglot-ensure): Use eglot--when-live-buffer. (eglot--managed-mode): Use eglot-documentation-functions and eldoc-documentation-strategy. (eglot--highlights): Move down. (eglot-signature-eldoc-function, eglot-hover-eldoc-function) (eglot--highlight-piggyback): New eldoc functions. (eglot--help-buffer, eglot--update-doc) (eglot-auto-display-help-buffer, eglot-put-doc-in-help-buffer) (eglot--truncate-string, eglot-doc-too-large-for-echo-area) (eglot-help-at-point): Remove all of this. (eglot--apply-workspace-edit): Call eldoc manually after an edit. (eglot-mode-map): Remap display-local-help to eldoc-doc-buffer
Commit a0249c8 remapped display-local-help to eglot-help-at-point. I used
C-h .
to show diagnostics errors at point. Now if there are documentation and diagnostics at point,C-h .
shows the former. Is there a keybinding to show the latter? If not, would it be possible to prioritize the diagnostics info and only show the documentation when, for example,C-h .
is invoked with a prefix argument?Thanks.
The text was updated successfully, but these errors were encountered: