[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/eglot2emacs 29f2ec2471 071/120: Consider diagnostic.code when ge
From: |
João Távora |
Subject: |
feature/eglot2emacs 29f2ec2471 071/120: Consider diagnostic.code when generating flymake diagnostics |
Date: |
Thu, 20 Oct 2022 07:16:57 -0400 (EDT) |
branch: feature/eglot2emacs
commit 29f2ec24713984d561881980aef578faa2a83068
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
Consider diagnostic.code when generating flymake diagnostics
Not sure this will please everybody, can almost guess someone is going
to ask for a custom switch.
Instead this info (and the source) should be passed on to Flymake.
That's where the custom switch for controlling formatting of
diagnostic messages should exist. But that's too much work right now.
* eglot.el (eglot-handle-notification): Consider Diagnostic.code.
---
lisp/progmodes/eglot.el | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 81c545e64f..3a33ad3ec2 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -1957,14 +1957,16 @@ COMMAND is a symbol naming the command."
(cond ((null sev) 'eglot-error)
((<= sev 1) 'eglot-error)
((= sev 2) 'eglot-warning)
- (t 'eglot-note))))
+ (t 'eglot-note)))
+ (mess (source code message)
+ (concat source (and code (concat " [" code "]")) ": " message)))
(if-let ((buffer (find-buffer-visiting (eglot--uri-to-path uri))))
(with-current-buffer buffer
(cl-loop
for diag-spec across diagnostics
- collect (eglot--dbind ((Diagnostic) range message severity source
tags)
+ collect (eglot--dbind ((Diagnostic) range code message severity
source tags)
diag-spec
- (setq message (concat source ": " message))
+ (setq message (mess source code message))
(pcase-let
((`(,beg . ,end) (eglot--range-region range)))
;; Fallback to `flymake-diag-region' if server
@@ -2001,8 +2003,8 @@ COMMAND is a symbol naming the command."
(cl-loop
with path = (expand-file-name (eglot--uri-to-path uri))
for diag-spec across diagnostics
- collect (eglot--dbind ((Diagnostic) range message severity source)
diag-spec
- (setq message (concat source ": " message))
+ 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))))
- feature/eglot2emacs 49e46c3d53 017/120: Add up-to-date server executables for html/css/json, (continued)
- feature/eglot2emacs 49e46c3d53 017/120: Add up-to-date server executables for html/css/json, João Távora, 2022/10/20
- feature/eglot2emacs 34c7da506d 020/120: Support autoimporttext from pyright language server, João Távora, 2022/10/20
- feature/eglot2emacs 9adb310e08 021/120: Don't error out on unsupported diagnostic.codedescription, João Távora, 2022/10/20
- feature/eglot2emacs 0f44d338f1 025/120: Support optional diagnostic.tags, João Távora, 2022/10/20
- feature/eglot2emacs 0739cdcf20 031/120: Improve backwards-compatibility of eglot-mode-map, João Távora, 2022/10/20
- feature/eglot2emacs 9710754080 042/120: Add support for optional completionitem.tags, João Távora, 2022/10/20
- feature/eglot2emacs c2d97d22aa 056/120: Implement on-type-formatting support, João Távora, 2022/10/20
- feature/eglot2emacs 1d9542cbe8 059/120: Protect against empty firsttriggercharacter strings, João Távora, 2022/10/20
- feature/eglot2emacs a63916f928 062/120: Tweak eglot mode-line menus, João Távora, 2022/10/20
- feature/eglot2emacs 4beab004d9 070/120: Ensure exit-function of eglot-c-at-point runs on exact match, João Távora, 2022/10/20
- feature/eglot2emacs 29f2ec2471 071/120: Consider diagnostic.code when generating flymake diagnostics,
João Távora <=
- feature/eglot2emacs cc5d1a5a72 091/120: Always default eglot-strict-mode to nil, João Távora, 2022/10/20
- feature/eglot2emacs e74e199912 093/120: Add out-of-box support for perl lsp server, João Távora, 2022/10/20
- feature/eglot2emacs d2e842bbf5 098/120: Prefer documentchanges to changes in server-initiated edits, João Távora, 2022/10/20
- feature/eglot2emacs e5f77f8ca5 100/120: Rework readme.md about workspace configuration again, João Távora, 2022/10/20
- feature/eglot2emacs ec7d63cbe7 105/120: Don't return hash tables from e-w-configuration-plist, João Távora, 2022/10/20
- feature/eglot2emacs 1780b93d66 111/120: Make clojure-lsp handle more major modes at once, João Távora, 2022/10/20
- feature/eglot2emacs 0848387fa2 115/120: Fix docstring of eglot-list-connections-mode, João Távora, 2022/10/20
- feature/eglot2emacs cf0ba0197a 007/120: Add support for the mint language server, João Távora, 2022/10/20
- feature/eglot2emacs ed9800041e 029/120: * eglot.el (eglot--connect): display seconds on timeout., João Távora, 2022/10/20
- feature/eglot2emacs ef0da9414e 060/120: Make eglot--plist-keys a simple (non-map.el) helper again, João Távora, 2022/10/20