diagnostics: support sending ALE output to Neovim's diagnostics API (#4345)

Support replacing ALE's display of problems with sending problems to the Neovim diagnostics API.

:help g:ale_use_neovim_diagnostics_api

Co-authored-by: David Balatero <dbalatero@users.noreply.github.com>
Co-authored-by: Georgi Angelchev <angelchev@live.co.uk>
Co-authored-by: w0rp <devw0rp@gmail.com>
This commit is contained in:
Ben Boeckel
2023-01-29 17:25:09 +00:00
committed by GitHub
parent 0af4899605
commit 116d713f63
9 changed files with 137 additions and 12 deletions

View File

@@ -121,6 +121,7 @@ circumstances.
ALE will report problems with your code in the following ways, listed with
their relevant options.
* Via the Neovim diagnostics API (Off by default) - |g:ale_use_neovim_diagnostics_api|
* By updating loclist. (On by default) - |g:ale_set_loclist|
* By updating quickfix. (Off by default) - |g:ale_set_quickfix|
* By setting error highlights. - |g:ale_set_highlights|
@@ -1235,7 +1236,7 @@ g:ale_floating_preview *g:ale_floating_preview*
|g:ale_detail_to_floating_preview| to `1`.
g:ale_floating_preview_popup_opts *g:ale_floating_preview_popup_opts*
g:ale_floating_preview_popup_opts *g:ale_floating_preview_popup_opts*
Type: |String| or |Dictionary|
Default: `''`
@@ -1258,7 +1259,7 @@ g:ale_floating_preview_popup_opts *g:ale_floating_preview_popup_opts
<
g:ale_floating_window_border *g:ale_floating_window_border*
g:ale_floating_window_border *g:ale_floating_window_border*
Type: |List|
Default: `['|', '-', '+', '+', '+', '+', '|', '-']`
@@ -2288,6 +2289,26 @@ g:ale_use_global_executables *g:ale_use_global_executables*
options.
g:ale_use_neovim_diagnostics_api *g:ale_use_neovim_diagnostics_api*
Type: |Number|
Default: `0`
If enabled, this option will disable ALE's standard UI, and instead send
all linter output to Neovim's diagnostics API. This allows you to collect
errors from nvim-lsp, ALE, and anything else that uses diagnostics all in
one place. The following options are ignored when using the diagnostics API:
- |g:ale_set_highlights|
- |g:ale_set_signs|
- |g:ale_virtualtext_cursor|
To enable this option, set the value to `1`.
This option requires Neovim 0.6+, as that version introduces the diagnostics
API.
g:ale_virtualtext_cursor *g:ale_virtualtext_cursor*
Type: |Number|