[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/elpa c2862f4 063/139: Don't auto-reconnect if last atte
From: |
João Távora |
Subject: |
[elpa] externals/elpa c2862f4 063/139: Don't auto-reconnect if last attempt lasted less than 3 seconds |
Date: |
Mon, 14 May 2018 09:53:35 -0400 (EDT) |
branch: externals/elpa
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/elpa 17e0ca4 047/139: Fix Flymake diagnostic positions, (continued)
- [elpa] externals/elpa 17e0ca4 047/139: Fix Flymake diagnostic positions, João Távora, 2018/05/14
- [elpa] externals/elpa 0e95167 042/139: Watch for files opened under umbrella of existing process, João Távora, 2018/05/14
- [elpa] externals/elpa 9665a3e 051/139: Fix textDocument/didChange, João Távora, 2018/05/14
- [elpa] externals/elpa 1514e0f 052/139: Fix a couple of Rust-related edge cases, João Távora, 2018/05/14
- [elpa] externals/elpa d90efdf 001/139: Initial commit, João Távora, 2018/05/14
- [elpa] externals/elpa 29d4103 056/139: Fix mode-line mouse-clicks from outside selected window, João Távora, 2018/05/14
- [elpa] externals/elpa ea918ab 066/139: Include source info in diagnostics, João Távora, 2018/05/14
- [elpa] externals/elpa 2b61a3b 048/139: Delete two useless forward declarations, João Távora, 2018/05/14
- [elpa] externals/elpa 7d0bf64 062/139: Workaround RLS's regusal to treat nil as empty json object, João Távora, 2018/05/14
- [elpa] externals/elpa e7ffc31 067/139: Make reported capabilities into its own function, João Távora, 2018/05/14
- [elpa] externals/elpa c2862f4 063/139: Don't auto-reconnect if last attempt lasted less than 3 seconds,
João Távora <=
- [elpa] externals/elpa e86f9b4 073/139: New helper eglot--sync-request, João Távora, 2018/05/14
- [elpa] externals/elpa 95187cf 058/139: Connect to LSP server via TCP, João Távora, 2018/05/14
- [elpa] externals/elpa f8bfb7e 064/139: Handle requests from server correctly, João Távora, 2018/05/14
- [elpa] externals/elpa 8160cd4 071/139: Handle dynamic registration in general (but nothing specific yet), João Távora, 2018/05/14
- [elpa] externals/elpa 9ff97a6 079/139: Increase request timeout length to 10 seconds, João Távora, 2018/05/14
- [elpa] externals/elpa 193c57d 075/139: Half-decent xref support, João Távora, 2018/05/14
- [elpa] externals/elpa d254f97 082/139: Solve another textDocument/didChange bug, João Távora, 2018/05/14
- [elpa] externals/elpa a7ddce6 080/139: Support javascript's javascript-typescript-langserver, João Távora, 2018/05/14
- [elpa] externals/elpa af14364 093/139: Only request stuff that server says it's capable of, João Távora, 2018/05/14
- [elpa] externals/elpa d33a9b5 103/139: Simplify eglot--signal-textDocument/didChange, João Távora, 2018/05/14