]> git.eshelyaron.com Git - emacs.git/commitdiff
Robustness fixes for the request mechanism
authorJoão Távora <joaotavora@gmail.com>
Sat, 19 May 2018 13:26:46 +0000 (14:26 +0100)
committerJoão Távora <joaotavora@gmail.com>
Sat, 19 May 2018 16:06:08 +0000 (17:06 +0100)
* eglot.el (eglot--async-request): Pass actual id to eglot--log-event
(eglot--request): Also cancel any continuations.

lisp/progmodes/eglot.el

index a5c4696131748a772430070244de4a5a6b3f4901..13d008689ca3b93dad4e63d7c503c34c2fd2f81f 100644 (file)
@@ -640,7 +640,7 @@ TIMER)."
                    (funcall (or timeout-fn
                                 (lambda ()
                                   (eglot--log-event
-                                   proc `(:timed-out ,method :id id
+                                   proc `(:timed-out ,method :id ,id
                                                      :params ,params)))))))))))
     (when deferred
       (let* ((buf (current-buffer))
@@ -703,7 +703,9 @@ DEFERRED is passed to `eglot--async-request', which see."
                                             ,(format "Ooops: %s: %s" code message))))
                   :deferred deferred))
                 (while t (accept-process-output nil 30)))
-            (when (cadr id-and-timer) (cancel-timer (cadr id-and-timer))))))
+            (pcase-let ((`(,id ,timer) id-and-timer))
+              (when id (remhash id (eglot--pending-continuations proc)))
+              (when timer (cancel-timer timer))))))
     (when (eq 'error (car res)) (eglot--error (cadr res)))
     (cadr res)))