[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot c2862f4 063/139: Don't auto-reconnect if last att
From: |
Jo�o T�vora |
Subject: |
[elpa] externals/eglot c2862f4 063/139: Don't auto-reconnect if last attempt lasted less than 3 seconds |
Date: |
Mon, 14 May 2018 09:54:54 -0400 (EDT) |
branch: externals/eglot
commit c2862f46c8330a0c0feaf871034166ed5d973894
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
Don't auto-reconnect if last attempt lasted less than 3 seconds
* eglot.el (eglot--inhibit-auto-reconnect): New var.
(eglot--process-sentinel): Use it.
---
eglot.el | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/eglot.el b/eglot.el
index 8f371d2..df03d04 100644
--- a/eglot.el
+++ b/eglot.el
@@ -329,6 +329,9 @@ INTERACTIVE is t if called interactively."
(with-current-buffer buffer
(eglot--maybe-activate-editing-mode proc))))))
+(defvar eglot--inhibit-auto-reconnect nil
+ "If non-nil, don't autoreconnect on unexpected quit.")
+
(defun eglot--process-sentinel (process change)
"Called with PROCESS undergoes CHANGE."
(eglot--debug "(sentinel) Process state changed to %s" change)
@@ -355,11 +358,20 @@ INTERACTIVE is t if called interactively."
(cond ((eglot--moribund process)
(eglot--message "(sentinel) Moribund process exited with status %s"
(process-exit-status process)))
- (t
+ ((null eglot--inhibit-auto-reconnect)
(eglot--warn
"(sentinel) Reconnecting after process unexpectedly changed to %s."
change)
- (eglot-reconnect process)))
+ (eglot-reconnect process)
+ (setq eglot--inhibit-auto-reconnect
+ (run-with-timer
+ 3 nil
+ (lambda ()
+ (setq eglot--inhibit-auto-reconnect nil)))))
+ (t
+ (eglot--warn
+ "(sentinel) Not auto-reconnecting, last one didn't last long."
+ change)))
(force-mode-line-update t)
(delete-process process)))
- [elpa] externals/eglot 51ff863 046/139: Must re-announce didOpen after reconnect, (continued)
- [elpa] externals/eglot 51ff863 046/139: Must re-announce didOpen after reconnect, Jo�o T�vora, 2018/05/14
- [elpa] externals/eglot c95a0a4 041/139: Multiple servers per project are possible, Jo�o T�vora, 2018/05/14
- [elpa] externals/eglot f8bfb7e 064/139: Handle requests from server correctly, Jo�o T�vora, 2018/05/14
- [elpa] externals/eglot b69302c 060/139: Make M-x eglot's interactive spec a separate function, Jo�o T�vora, 2018/05/14
- [elpa] externals/eglot b657b32 068/139: Use rootUri instead of rootPath, Jo�o T�vora, 2018/05/14
- [elpa] externals/eglot 7d0bf64 062/139: Workaround RLS's regusal to treat nil as empty json object, Jo�o T�vora, 2018/05/14
- [elpa] externals/eglot 75495dc 033/139: Slightly more user friendly start, Jo�o T�vora, 2018/05/14
- [elpa] externals/eglot fdb4de1 039/139: Simplify flymake integration, Jo�o T�vora, 2018/05/14
- [elpa] externals/eglot cc183a6 043/139: Fix assorted bugs, Jo�o T�vora, 2018/05/14
- [elpa] externals/eglot df5d76d 065/139: Reply to client/registerCapability (don't handle it yet), Jo�o T�vora, 2018/05/14
- [elpa] externals/eglot c2862f4 063/139: Don't auto-reconnect if last attempt lasted less than 3 seconds,
Jo�o T�vora <=
- [elpa] externals/eglot f1b6485 053/139: Trim some edges and add a bunch of boring RPC methods, Jo�o T�vora, 2018/05/14
- [elpa] externals/eglot 0e95167 042/139: Watch for files opened under umbrella of existing process, Jo�o T�vora, 2018/05/14
- [elpa] externals/eglot 4d4b85d 061/139: eglot-editing-mode becomes eglot--managed-mode, Jo�o T�vora, 2018/05/14
- [elpa] externals/eglot e7ffc31 067/139: Make reported capabilities into its own function, Jo�o T�vora, 2018/05/14
- [elpa] externals/eglot 79a2a1e 069/139: Be quite explicit about our lack of capabilities right now, Jo�o T�vora, 2018/05/14
- [elpa] externals/eglot 95187cf 058/139: Connect to LSP server via TCP, Jo�o T�vora, 2018/05/14
- [elpa] externals/eglot f76f04e 057/139: More correctly keep track of didOpen/didClose per buffer, Jo�o T�vora, 2018/05/14
- [elpa] externals/eglot 46bb1c0 049/139: Reorganize file, Jo�o T�vora, 2018/05/14
- [elpa] externals/eglot ff5a03d 074/139: Very basic xref support, Jo�o T�vora, 2018/05/14
- [elpa] externals/eglot e9b5e54 077/139: ETOOMANYLAMBDAS, Jo�o T�vora, 2018/05/14