branch: externals/eglot
commit 66adb2f428b9f6a990bafcba40cd6ca325a4aa84
Author: João Távora <>
Commit: João Távora <>

    Fix a bug when eglot--request times out
    * eglot.el (eglot--request): Better timeout
    (eglot--async-request): Must return the timer.
 eglot.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/eglot.el b/eglot.el
index e438c49..7bef2ec 100644
--- a/eglot.el
+++ b/eglot.el
@@ -737,7 +737,7 @@ happens, the original timer keeps counting). Return (ID 
                        (setf (eglot--status server) `(,message t))
                        server `(:message "error ignored, status set"
                                          :id ,id :error ,code)))
-                 (or timer (funcall make-timer)))
+                 (setq timer (or timer (funcall make-timer))))
              (eglot--pending-continuations server))
     (list id timer)))
@@ -758,7 +758,10 @@ DEFERRED is passed to `eglot--async-request', which see."
                   server method params
                   :success-fn (lambda (result) (throw done `(done ,result)))
-                  :timeout-fn (lambda () (throw done '(error "Timed out")))
+                  :timeout-fn (lambda () (throw done
+                                                `(error
+                                                  ,(format "Request id=%s 
timed out"
+                                                           (car 
                   :error-fn (eglot--lambda (&key code message _data)
                               (throw done `(error
                                             ,(format "Ooops: %s: %s" code 

Reply via email to