Skip to content

Commit 71a9a69

Browse files
committed
Add defcustom to control default error level for Flymake.
This creates a custom setting similar to what already exists for Flycheck. Additionally, the default value is now made consistent with the default value for Flycheck (i.e., error instead of note).
1 parent 5a20661 commit 71a9a69

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

lsp-diagnostics.el

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,15 @@
5858
(const info))
5959
:group 'lsp-diagnostics)
6060

61+
(defcustom lsp-diagnostics-flymake-default-level :error
62+
"Error level to use when the server does not report back a diagnostic level."
63+
:type '(choice
64+
(const :tag "Error" :error)
65+
(const :tag "Warning" :warning)
66+
(const :tag "Note" :note))
67+
:group 'lsp-diagnostics
68+
:package-version '(lsp-mode . "9.0.1"))
69+
6170
(defcustom lsp-diagnostics-attributes
6271
`((unnecessary :foreground "gray")
6372
(deprecated :strike-through t))
@@ -311,7 +320,9 @@ See https://github.com/emacs-lsp/lsp-mode."
311320
(cl-case severity?
312321
(1 :error)
313322
(2 :warning)
314-
(t :note))
323+
(3 :note)
324+
(4 :note)
325+
(t lsp-diagnostics-flymake-default-level))
315326
message))))
316327
;; This :region keyword forces flymake to delete old diagnostics in
317328
;; case the buffer hasn't changed since the last call to the report

0 commit comments

Comments
 (0)