Skip to content

Commit

Permalink
Add defcustom to control default error level for Flymake.
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
brownts committed Apr 20, 2024
1 parent 5a20661 commit 71a9a69
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lsp-diagnostics.el
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@
(const info))
:group 'lsp-diagnostics)

(defcustom lsp-diagnostics-flymake-default-level :error
"Error level to use when the server does not report back a diagnostic level."
:type '(choice
(const :tag "Error" :error)
(const :tag "Warning" :warning)
(const :tag "Note" :note))
:group 'lsp-diagnostics
:package-version '(lsp-mode . "9.0.1"))

(defcustom lsp-diagnostics-attributes
`((unnecessary :foreground "gray")
(deprecated :strike-through t))
Expand Down Expand Up @@ -311,7 +320,9 @@ See https://github.com/emacs-lsp/lsp-mode."
(cl-case severity?
(1 :error)
(2 :warning)
(t :note))
(3 :note)
(4 :note)
(t lsp-diagnostics-flymake-default-level))
message))))
;; This :region keyword forces flymake to delete old diagnostics in
;; case the buffer hasn't changed since the last call to the report
Expand Down

0 comments on commit 71a9a69

Please sign in to comment.