]> git.eshelyaron.com Git - emacs.git/commitdiff
Query Eglot version via package.el
authorPhilip Kaludercic <philipk@posteo.net>
Thu, 7 Mar 2024 09:21:45 +0000 (10:21 +0100)
committerEshel Yaron <me@eshelyaron.com>
Mon, 6 May 2024 16:37:58 +0000 (18:37 +0200)
* lisp/progmodes/eglot.el (eglot--version): Remove constant.
(eglot--connect): Use 'package-get-version'.

(cherry picked from commit 3d4918c2f1d10df4051ca7dc1d17decf157adb3f)

lisp/progmodes/eglot.el

index 406e7cf91a2fba646f7777693c1419b5074609ad..fefd4b87a17ebfda4a47c1e9032858662c26b573 100644 (file)
@@ -565,13 +565,6 @@ This can be useful when using docker to run a language server.")
 \f
 ;;; 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")
@@ -1606,8 +1599,10 @@ This docstring appeases checkdoc, that's all."
                                             'network))
                               (emacs-pid))
                             :clientInfo
-                            `(:name "Eglot" ,@(when eglot--version
-                                                `(:version ,eglot--version)))
+                            (append
+                             '(:name "Eglot")
+                             (let ((v (package-get-version)))
+                               (and v (list :version v))))
                             ;; Maybe turn trampy `/ssh:foo@bar:/path/to/baz.py'
                             ;; into `/path/to/baz.py', so LSP groks it.
                             :rootPath (file-local-name