From df775108a9d0c5171ca6eeb19af752bec15c626a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felici=C3=A1n=20N=C3=A9meth?= Date: Sat, 15 Jul 2023 12:02:49 +0200 Subject: [PATCH] Eglot: send version in clientInfo (bug#62198) * lisp/progmodes/eglot.el (eglot--version): New defconst. (eglot--connect): Use it. --- lisp/progmodes/eglot.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 8ac21638a5..0da4641fba 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -421,6 +421,14 @@ eglot-withhold-process-id ;;; Constants ;;; +(defconst eglot--version + (eval-when-compile + (when byte-compile-current-file + (require 'lisp-mnt) + (lm-version byte-compile-current-file))) + "The version as a string of this version of Eglot. +It is nil if Eglot is not byte-complied.") + (defconst eglot--symbol-kind-names `((1 . "File") (2 . "Module") (3 . "Namespace") (4 . "Package") (5 . "Class") @@ -1352,7 +1360,9 @@ eglot--connect (eq (jsonrpc-process-type server) 'network)) (emacs-pid)) - :clientInfo '(:name "Eglot") + :clientInfo + `(:name "Eglot" ,@(when eglot--version + `(:version ,eglot--version))) ;; Maybe turn trampy `/ssh:foo@bar:/path/to/baz.py' ;; into `/path/to/baz.py', so LSP groks it. :rootPath (file-local-name -- 2.39.2