emacs-lsp / lsp-mode

Emacs client/library for the Language Server Protocol
https://emacs-lsp.github.io/lsp-mode
GNU General Public License v3.0
4.79k stars 889 forks source link

Warnings listed as lsp-flycheck-warning-unnecessary #3894

Closed dpassen closed 1 year ago

dpassen commented 1 year ago

Thank you for the bug report

Bug description

Various warnings as reported to Flycheck have the level lsp-flycheck-warning-unnecessary instead of warning. This breaks code that relies on (flycheck-has-current-errors-p 'warning) for example https://github.com/flycheck/flycheck-color-mode-line/blob/575b604cfe21f65fb07c134392c382c163c87739/flycheck-color-mode-line.el#L115

Steps to reproduce

In a Clojure buffer, with lsp-mode started and connected to a clojure-lsp server, add to the ns :require or :import clause, something unused.

Expected behavior

I expect flycheck-list-errors to show the message, along with the Level of warning.

Which Language Server did you use?

clojure-lsp

OS

MacOS

Error callstack

No response

Anything else?

No response

ericdallo commented 1 year ago

@yyoncho do you know if Is it possible to change the flycheck level to warning but keep using the unnecessary face elsewhere?

dpassen commented 1 year ago

@ericdallo Looks like this has been discussed https://github.com/emacs-lsp/lsp-mode/issues/1961