-
-
Notifications
You must be signed in to change notification settings - Fork 890
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for LSP diagnostic "additional information".
This change provides support for additional information that can be provided with an LSP diagnostic, for both Flycheck and Flymake interfaces. The main change treats each piece of "additional information" as a separate diagnostic with the same severity level as the main diagnostic. Flycheck supports the concept of a group, so for Flycheck diagnostics the main diagnostic and all of it's "additional information" diagnostics are placed in the same Flycheck group. "Additional information" diagnostics may refer to a file which is not the current buffer. Flycheck handles this as part of it's normal diagnostic interface, however Flymake makes a distinction between diagnostics related to the current buffer and those external to it (i.e., foreign diagnostics). For Flymake, the foreign diagnostics are managed in the `flymake-list-only-diagnostics` variable. Flymake treats these as interim diagnostics until the file has been opened. Therefore, diagnostics placed in `flymake-list-only-diagnostics` are removed when that buffer reports its own diagnostics. Additionally, with Flymake, foreign diagnostics are only visible when reporting diagnostics for the project (`flymake-show-project-diagnostics`), not when reporting diagnostics for the current buffer (`flymake-show-buffer-diagnostics`). Flycheck on the other hand, does not make this distinction and will report both types of diagnostics together (`flycheck-list-errors`). Additional changes that drive conformity between Flycheck and Flymake were also applied. When an LSP diagnostic provides a source, this is supplied to Flycheck as the "checker", otherwise the default "lsp" checker is used. This is useful to properly identify the LSP backends generating the diagnostics when it is available. Flymake doesn't provide a way to specify the checker (or a code), so the diagnostic message is appended with this information when provided.
- Loading branch information
Showing
1 changed file
with
202 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters