From 5b8aa5c90851528bc8a04aaefc891fff6be6846b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Sat, 19 May 2018 14:26:46 +0100 Subject: [PATCH] Robustness fixes for the request mechanism * eglot.el (eglot--async-request): Pass actual id to eglot--log-event (eglot--request): Also cancel any continuations. --- lisp/progmodes/eglot.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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))) -- 2.39.2