From: João Távora Date: Sat, 19 May 2018 13:26:46 +0000 (+0100) Subject: Robustness fixes for the request mechanism X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~553 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5b8aa5c90851528bc8a04aaefc891fff6be6846b;p=emacs.git Robustness fixes for the request mechanism * eglot.el (eglot--async-request): Pass actual id to eglot--log-event (eglot--request): Also cancel any continuations. --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index a5c46961317..13d008689ca 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -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)))