]> git.eshelyaron.com Git - emacs.git/commitdiff
Eglot: use richer diagnostic-making capability of Flymake 1.4.0
authorJoão Távora <joaotavora@gmail.com>
Fri, 18 Apr 2025 18:45:54 +0000 (19:45 +0100)
committerEshel Yaron <me@eshelyaron.com>
Tue, 22 Apr 2025 17:26:17 +0000 (19:26 +0200)
* lisp/progmodes/eglot.el (Package-Requires): Require Flymake
1.4.0.
(eglot-handle-notification): Tweak.

(cherry picked from commit 7ac6b33560a0449eb4b69664790f97124bfc2933)

lisp/progmodes/eglot.el

index 685b67d4c27b4faf1854bfa194b3aa83409bf44a..a6aea329f595cb5bd07d5b8fb8c6f14585db87bc 100644 (file)
@@ -7,7 +7,7 @@
 ;; Maintainer: João Távora <joaotavora@gmail.com>
 ;; URL: https://github.com/joaotavora/eglot
 ;; Keywords: convenience, languages
-;; Package-Requires: ((emacs "26.3") (eldoc "1.14.0") (external-completion "0.1") (flymake "1.2.1") (jsonrpc "1.0.24") (project "0.9.8") (seq "2.23") (xref "1.6.2"))
+;; Package-Requires: ((emacs "26.3") (eldoc "1.14.0") (external-completion "0.1") (flymake "1.4.0") (jsonrpc "1.0.24") (project "0.9.8") (seq "2.23") (xref "1.6.2"))
 
 ;; This is a GNU ELPA :core package.  Avoid adding functionality
 ;; that is not available in the version of Emacs recorded above or any
@@ -2720,8 +2720,6 @@ expensive cached value of `file-truename'.")
                     ((<= sev 1) 'eglot-error)
                     ((= sev 2)  'eglot-warning)
                     (t          'eglot-note)))
-            (mess (source code message)
-              (concat source (and code (format " [%s]" code)) ": " message))
             (find-it (abspath)
               ;; `find-buffer-visiting' would be natural, but calls the
               ;; potentially slow `file-truename' (bug#70036).
@@ -2742,14 +2740,14 @@ expensive cached value of `file-truename'.")
            for diag-spec across diagnostics
            collect (eglot--dbind ((Diagnostic) range code message severity source tags)
                        diag-spec
-                     (setq message (mess source code message))
                      (pcase-let
                          ((`(,beg . ,end) (eglot--diag-range-region range)))
                        (eglot--make-diag
                         (current-buffer) beg end
                         (eglot--diag-type severity)
-                        message `((eglot-lsp-diag . ,diag-spec)
-                                  (eglot--doc-version . ,version))
+                        (list source code message)
+                        `((eglot-lsp-diag . ,diag-spec)
+                          (eglot--doc-version . ,version))
                         (when-let ((faces
                                     (cl-loop for tag across tags
                                              when (alist-get tag eglot--tag-faces)
@@ -2768,12 +2766,12 @@ expensive cached value of `file-truename'.")
       (cl-loop
        for diag-spec across diagnostics
        collect (eglot--dbind ((Diagnostic) code range message severity source) diag-spec
-                 (setq message (mess source code message))
                  (let* ((start (plist-get range :start))
                         (line (1+ (plist-get start :line)))
                         (char (1+ (plist-get start :character))))
                    (eglot--make-diag
-                    path (cons line char) nil (eglot--diag-type severity) message)))
+                    path (cons line char) nil (eglot--diag-type severity)
+                    (list source code message))))
        into diags
        finally
        (setq flymake-list-only-diagnostics