;; 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
((<= 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).
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)
(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