From 2c093aeb840f528270b3b3969e9506dd1f9a1ef2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Tue, 8 May 2018 01:52:27 +0100 Subject: [PATCH] When killing server, always wait 3 seconds * eglot.el (eglot--request): Accept TIMEOUT param. --- lisp/progmodes/eglot.el | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 2e409ef840f..9ce7e261a31 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -552,10 +552,12 @@ is a symbol saying if this is a client or server originated." (cl-defun eglot--request (process method params - &key success-fn error-fn timeout-fn (async-p t)) + &key success-fn error-fn timeout-fn (async-p t) + (timeout eglot-request-timeout)) "Make a request to PROCESS, expecting a reply. Return the ID of this request, unless ASYNC-P is nil, in which -case never returns locally." +case never returns locally. Wait TIMEOUT seconds for a +response." (let* ((id (eglot--next-request-id)) (timeout-fn (or timeout-fn (lambda () @@ -583,7 +585,7 @@ case never returns locally." (catch catch-tag (let ((timeout-timer (run-with-timer - eglot-request-timeout nil + timeout nil (if async-p (lambda () (remhash id (eglot--pending-continuations process)) @@ -912,10 +914,12 @@ running. INTERACTIVE is t if called interactively." :success-fn brutal :async-p (not sync) :error-fn brutal - :timeout-fn brutal)) + :timeout-fn brutal + :timeout 3)) :error-fn brutal :async-p (not sync) - :timeout-fn brutal))) + :timeout-fn brutal + :timeout 3))) (cl-defun eglot--server-window/showMessage (_process &key type message) "Handle notification window/showMessage" -- 2.39.2