From: Felicián Németh Date: Sat, 15 Jul 2023 10:02:49 +0000 (+0200) Subject: Eglot: send version in clientInfo (bug#62198) X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=859b150f3171d4946a383e07a9333c4df8efdd98;p=emacs.git Eglot: send version in clientInfo (bug#62198) * lisp/progmodes/eglot.el (eglot--version): New defconst. (eglot--connect): Use it. --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index ae31985a676..37875e3d7f1 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -421,6 +421,14 @@ This can be useful when using docker to run a language server.") ;;; 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 @@ This docstring appeases checkdoc, that's all." (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