emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/eglot 97ed4ca 49/49: Close #643: add new command eglot-


From: Stefan Monnier
Subject: [elpa] externals/eglot 97ed4ca 49/49: Close #643: add new command eglot-shutdown-all
Date: Wed, 17 Mar 2021 18:41:51 -0400 (EDT)

branch: externals/eglot
commit 97ed4caff5f6c09910ef6bfa64671d25a8a6772b
Author: bc² <odanoburu@users.noreply.github.com>
Commit: GitHub <noreply@github.com>

    Close #643: add new command eglot-shutdown-all
    
    Also closes #644
    Co-authored-by: João Távora <joaotavora@gmail.com>
    Copyright-paperwork-exempt: yes
    
    * NEWS.md: mention new command
    
    * README.md (Commands and keybindings): mention new command.  Tweak
    documentation for eglot-shutdown and eglot-reconnect.
    
    * eglot.el (eglot-shutdown): Tweak docstring.
    (eglot-shutdown-all): New command.
---
 NEWS.md   |  5 ++++-
 README.md |  6 ++++--
 eglot.el  | 12 ++++++++++--
 3 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/NEWS.md b/NEWS.md
index ced91b6..d060ad4 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -5,7 +5,7 @@
 Thanks to Brian Cully for the minimalist approach.
 
 (also thanks to Felipe Lema who conducted many early experiments in
-#463)
+[#463][github#463])
 
 ##### Code action shortcuts ([#411][github#411])
 
@@ -18,6 +18,8 @@ actions directly (`eglot-code-action-inline`,
 actions with specific a kind by calling `eglot-code-actions` from
 elisp.
 
+##### New command `eglot-shutdown-server` ([#643][github#643])
+
 # 1.7 (16/12/2020)
 
 ##### Support hierarchical symbols in Imenu ([#303][github#303])
@@ -260,3 +262,4 @@ and now said bunch of references-->
 [github#481]: https://github.com/joaotavora/eglot/issues/481
 [github#494]: https://github.com/joaotavora/eglot/issues/494
 [github#637]: https://github.com/joaotavora/eglot/issues/637
+[github#643]: https://github.com/joaotavora/eglot/issues/643
diff --git a/README.md b/README.md
index bb0225a..28e7b61 100644
--- a/README.md
+++ b/README.md
@@ -226,9 +226,11 @@ Here's a summary of available commands:
 
 - `M-x eglot`, as described above;
 
-- `M-x eglot-reconnect` reconnects to the server;
+- `M-x eglot-reconnect` reconnects to current server;
 
-- `M-x eglot-shutdown` says bye-bye to the server;
+- `M-x eglot-shutdown` says bye-bye to server of your choice;
+
+- `M-x eglot-shutdown-all` says bye-bye to every server;
 
 - `M-x eglot-rename` ask the server to rename the symbol at point;
 
diff --git a/eglot.el b/eglot.el
index 79b9088..0341ffd 100644
--- a/eglot.el
+++ b/eglot.el
@@ -652,11 +652,12 @@ Interactively, read SERVER from the minibuffer unless 
there is
 only one and it's managing the current buffer.
 
 Forcefully quit it if it doesn't respond within TIMEOUT seconds.
-Don't leave this function with the server still running.
+TIMEOUT defaults to 1.5 seconds.  Don't leave this function with
+the server still running.
 
 If PRESERVE-BUFFERS is non-nil (interactively, when called with a
 prefix argument), do not kill events and output buffers of
-SERVER.  ."
+SERVER."
   (interactive (list (eglot--read-server "Shutdown which server"
                                          (eglot-current-server))
                      t nil current-prefix-arg))
@@ -670,6 +671,13 @@ SERVER.  ."
     (jsonrpc-shutdown server (not preserve-buffers))
     (unless preserve-buffers (kill-buffer (jsonrpc-events-buffer server)))))
 
+(defun eglot-shutdown-all (&optional preserve-buffers)
+  "Politely ask all language servers to quit, in order.
+PRESERVE-BUFFERS as in `eglot-shutdown', which see."
+  (interactive (list current-prefix-arg))
+  (cl-loop for ss being the hash-values of eglot--servers-by-project
+           do (cl-loop for s in ss do (eglot-shutdown s nil 
preserve-buffers))))
+
 (defun eglot--on-shutdown (server)
   "Called by jsonrpc.el when SERVER is already dead."
   ;; Turn off `eglot--managed-mode' where appropriate.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]