Make eglot--clangd-version more robust

* test/lisp/progmodes/eglot-tests.el (eglot--clangd-version): Check
for 'version ' followed by a combination of numbers and dots to
extract the clangd version.
This commit is contained in:
Robert Pluim 2023-03-22 12:46:11 +01:00
parent 2d0de86361
commit 103ebbf92f

View file

@ -316,9 +316,10 @@ then restored."
(defun eglot--clangd-version ()
"Report on the clangd version used in various tests."
(replace-regexp-in-string
".*version[[:space:]]+\\(.*\\)" "\\1"
(car (split-string (shell-command-to-string "clangd --version") "\n"))))
(let ((version (shell-command-to-string "clangd --version")))
(when (string-match "version[[:space:]]+\\([0-9.]*\\)"
version)
(match-string 1 version))))
;;; Unit tests