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

@@ -4,6 +4,7 @@ Before:
Save g:ale_virtualtext_delay
Save g:ale_virtualtext_prefix
Save b:ale_virtualtext_prefix
Save g:ale_use_neovim_diagnostics_api
call ale#virtualtext#ResetDataForTests()
@@ -36,6 +37,7 @@ Before:
\ ],
\ },
\}
let g:ale_use_neovim_diagnostics_api = 0
After:
Restore
@@ -177,3 +179,16 @@ Execute(We should set errors across all lines):
\ map(prop_list(2), {_, v -> v.type})
endif
endif
Execute(We should not set cursor messages when Neovim diagnostics are enabled):
let g:ale_use_neovim_diagnostics_api = 1
if has('patch-9.0.0297') || has('nvim-0.8.0')
let g:ale_virtualtext_cursor = 'current'
call cursor(1, 1)
call ale#virtualtext#ShowCursorWarningWithDelay()
" Tick the timer.
sleep 1ms
AssertEqual '', ale#virtualtext#GetLastMessageForTests()
endif