[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/eglot2emacs b07fa37d04 113/120: Add half-baked m-x eglot-list-co
From: |
João Távora |
Subject: |
feature/eglot2emacs b07fa37d04 113/120: Add half-baked m-x eglot-list-connections |
Date: |
Thu, 20 Oct 2022 07:17:08 -0400 (EDT) |
branch: feature/eglot2emacs
commit b07fa37d04d98fcd9856f9f29fc1323850c230b7
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
Add half-baked m-x eglot-list-connections
Not very useful for now, but more functionality could be added later,
like bindings for disconnecting a given connection, switching to its
events buffers, or just listing some details like capabilities.
* eglot.el (eglot-list-connections-mode, eglot-list-connections):
New mode and function.
---
lisp/progmodes/eglot.el | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 010f8c86c7..918bba6210 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -3317,6 +3317,40 @@ If NOERROR, return predicate, else erroring function."
`(,self () (re-search-forward ,(concat "\\=" arg)) (,next)))
+;;; List connections mode
+
+(define-derived-mode eglot-list-connections-mode tabulated-list-mode
+ "" "Eglot Connection List Mode
+
+\\{sly-connection-list-mode-map}"
+ (setq-local tabulated-list-format
+ `[("Language server" 16) ("Project name" 16) ("Modes handled"
16)])
+ (tabulated-list-init-header))
+
+(defun eglot-list-connections ()
+ "List currently active Eglot connections."
+ (interactive)
+ (with-current-buffer
+ (get-buffer-create "*EGLOT connections*")
+ (let ((inhibit-read-only t))
+ (erase-buffer)
+ (eglot-list-connections-mode)
+ (setq-local tabulated-list-entries
+ (mapcar
+ (lambda (server)
+ (list server
+ `[,(or (plist-get (eglot--server-info server) :name)
+ (jsonrpc-name server))
+ ,(eglot-project-nickname server)
+ ,(mapconcat #'symbol-name
+ (eglot--major-modes server)
+ ", ")]))
+ (cl-reduce #'append
+ (hash-table-values eglot--servers-by-project))))
+ (revert-buffer)
+ (pop-to-buffer (current-buffer)))))
+
+
;;; Hacks
;;;
;; FIXME: Although desktop.el compatibility is Emacs bug#56407, the
- feature/eglot2emacs 49e56e47d8 066/120: Solve flymake diagnostics synchronization problems, (continued)
- feature/eglot2emacs 49e56e47d8 066/120: Solve flymake diagnostics synchronization problems, João Távora, 2022/10/20
- feature/eglot2emacs 917e8ffa31 080/120: Add support for jedi-language-server, João Távora, 2022/10/20
- feature/eglot2emacs 9dbc18cbfa 084/120: Tweak some details, fix some bugs, João Távora, 2022/10/20
- feature/eglot2emacs 2a12f622dc 087/120: Eglot-workspace-configuration can be a function, João Távora, 2022/10/20
- feature/eglot2emacs 1986c4df88 089/120: Reply more reasonably to server's workspace/applyedit, João Távora, 2022/10/20
- feature/eglot2emacs bef332a983 101/120: Adjust last commit about workspace configuration, João Távora, 2022/10/20
- feature/eglot2emacs 523547321e 102/120: Allow :initializationoptions in eglot-server-programs, João Távora, 2022/10/20
- feature/eglot2emacs 68b9c03b44 106/120: Don't use three-argument plist-get, João Távora, 2022/10/20
- feature/eglot2emacs 0829d5e7a2 107/120: Revert "fix jdtls support", João Távora, 2022/10/20
- feature/eglot2emacs b205479035 108/120: Fix blunder in eglot--guess-contact, João Távora, 2022/10/20
- feature/eglot2emacs b07fa37d04 113/120: Add half-baked m-x eglot-list-connections,
João Távora <=
- feature/eglot2emacs 4f1f06375a 045/120: Prevent empty diagnostic tags vector hiding main fontification, João Távora, 2022/10/20
- feature/eglot2emacs be47552331 049/120: Change capability 'documentchanges' to t, João Távora, 2022/10/20
- feature/eglot2emacs 27ba1994fe 038/120: ; fix thinko in last commit, João Távora, 2022/10/20