From 93e2438c7a4a44812d228f05df72deead7945328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felici=C3=A1n=20N=C3=A9meth?= Date: Fri, 22 Nov 2019 18:35:01 +0100 Subject: [PATCH] Make a public reader for project-nickname Per #354 * eglot.el (eglot-lsp-server): Add a public reader for project-nickname as eglot-project-nickname. (eglot--connect, eglot--read-server, eglot--mode-line-format): Use the public variant. --- eglot.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/eglot.el b/eglot.el index f6997fea..a6d895a6 100644 --- a/eglot.el +++ b/eglot.el @@ -525,7 +525,8 @@ treated as in `eglot-dbind'." (defclass eglot-lsp-server (jsonrpc-process-connection) ((project-nickname :documentation "Short nickname for the associated project." - :accessor eglot--project-nickname) + :accessor eglot--project-nickname + :reader eglot-project-nickname) (major-mode :documentation "Major mode symbol." :accessor eglot--major-mode) @@ -904,7 +905,7 @@ in project `%s'." (or (plist-get serverInfo :name) (jsonrpc-name server)) managed-major-mode - (eglot--project-nickname server)) + (eglot-project-nickname server)) (when tag (throw tag t)))) :timeout eglot-connect-timeout :error-fn (eglot--lambda ((ResponseError) code message) @@ -1170,7 +1171,7 @@ and just return it. PROMPT shouldn't end with a question mark." being hash-values of eglot--servers-by-project append servers)) (name (lambda (srv) - (format "%s/%s" (eglot--project-nickname srv) + (format "%s/%s" (eglot-project-nickname srv) (eglot--major-mode srv))))) (cond ((null servers) (eglot--error "No servers!")) @@ -1374,7 +1375,7 @@ Uses THING, FACE, DEFS and PREPEND." (defun eglot--mode-line-format () "Compose the EGLOT's mode-line." (pcase-let* ((server (eglot-current-server)) - (nick (and server (eglot--project-nickname server))) + (nick (and server (eglot-project-nickname server))) (pending (and server (hash-table-count (jsonrpc--request-continuations server)))) (`(,_id ,doing ,done-p ,_detail) (and server (eglot--spinner server)))