emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/eglot d6a6de7 03/69: Fix test failure introduced by pre


From: João Távora
Subject: [elpa] externals/eglot d6a6de7 03/69: Fix test failure introduced by previous commit
Date: Sun, 20 Oct 2019 08:21:41 -0400 (EDT)

branch: externals/eglot
commit d6a6de75558f3ffa940735d5a4ece59b45f2ef4e
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>

    Fix test failure introduced by previous commit
    
    Remove the hack of unsetting eldoc-last-message in
    eglot--eldoc-message.  This allows any subsequent eglot-eldoc-function
    calls (prompted by simple cursor movement) to return it immediately,
    thus refreshing the help buffer with the same contents.  For this to
    work, we also have to set eglot--eldoc-hint globally in
    eglot-eldoc-function.
    
    An alternative to making the test pass would be to keep the hack of
    unsetting eldoc-last-message only in the case that we actually get to
    display the help buffer.  This would actually be more efficient, but
    potentially more hacky.
    
    The bottom line here is that eldoc doesn't have a good API to deal
    with asynchronous docstring fetching.  See this thread:
    
    https://lists.gnu.org/archive/html/emacs-devel/2018-05/msg00151.html
    
    * eglot.el (eglot--eldoc-message): Don't unset eldoc-last-message.
    (eglot-eldoc-function): Set eglot--eldoc-hint for synchronous
    operation too.
---
 eglot.el | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/eglot.el b/eglot.el
index fb002b8..a7740e5 100644
--- a/eglot.el
+++ b/eglot.el
@@ -2068,12 +2068,12 @@ Buffer is displayed with `display-buffer', which obeys
           (erase-buffer)
           (insert string)
           (goto-char (point-min))
-          (setq eldoc-last-message nil)
-          (if eglot-auto-display-eldoc-extra-buffer
-              (display-buffer (current-buffer))
-            (unless (get-buffer-window (current-buffer))
-              (eglot--message "Help for %s in in %s buffer" eglot--eldoc-hint
-                              (buffer-name eglot--help-buffer))))
+          (cond (eglot-auto-display-eldoc-extra-buffer
+                 (display-buffer (current-buffer)))
+                (t
+                 (unless (get-buffer-window (current-buffer))
+                   (eglot--message "Help for %s is in %s buffer" 
eglot--eldoc-hint
+                                   (buffer-name eglot--help-buffer)))))
           (help-mode)
           t)))))
 
@@ -2085,6 +2085,7 @@ If SKIP-SIGNATURE, don't try to send 
textDocument/signatureHelp."
          (position-params (eglot--TextDocumentPositionParams))
          sig-showing
          (thing-at-point (thing-at-point 'symbol)))
+    (setq eglot--eldoc-hint thing-at-point)
     (cl-macrolet ((when-buffer-window
                    (&body body) ; notice the exception when testing with `ert'
                    `(when (or (get-buffer-window buffer) (ert-running-test))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]