emacs-diffs
[Top][All Lists]
Advanced

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

master 859b150f317: Eglot: send version in clientInfo (bug#62198)


From: Eli Zaretskii
Subject: master 859b150f317: Eglot: send version in clientInfo (bug#62198)
Date: Thu, 3 Aug 2023 06:19:33 -0400 (EDT)

branch: master
commit 859b150f3171d4946a383e07a9333c4df8efdd98
Author: Felicián Németh <felician.nemeth@gmail.com>
Commit: Eli Zaretskii <eliz@gnu.org>

    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 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



reply via email to

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