mirror of
https://github.com/dense-analysis/ale.git
synced 2026-02-04 17:12:53 +08:00
#3600 Implement pull model with Neovim Client
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--lua-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--lua-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
Implement the diagnostics pull model with the LSP Neovim client. We must handle messages a little different and tweak client capabilities for pull diagnostics to work through the Neovim client.
This commit is contained in:
@@ -100,7 +100,7 @@ endfunction
|
||||
" Handle LSP diagnostics for a given URI.
|
||||
" The special value 'unchanged' can be used for diagnostics to indicate
|
||||
" that diagnostics haven't changed since we last checked.
|
||||
function! s:HandleLSPDiagnostics(conn_id, uri, diagnostics) abort
|
||||
function! ale#lsp_linter#HandleLSPDiagnostics(conn_id, uri, diagnostics) abort
|
||||
let l:linter = get(s:lsp_linter_map, a:conn_id)
|
||||
|
||||
if empty(l:linter)
|
||||
@@ -233,14 +233,14 @@ function! ale#lsp_linter#HandleLSPResponse(conn_id, response) abort
|
||||
let l:uri = a:response.params.uri
|
||||
let l:diagnostics = a:response.params.diagnostics
|
||||
|
||||
call s:HandleLSPDiagnostics(a:conn_id, l:uri, l:diagnostics)
|
||||
call ale#lsp_linter#HandleLSPDiagnostics(a:conn_id, l:uri, l:diagnostics)
|
||||
elseif has_key(s:diagnostic_uri_map, get(a:response, 'id'))
|
||||
let l:uri = remove(s:diagnostic_uri_map, a:response.id)
|
||||
let l:diagnostics = a:response.result.kind is# 'unchanged'
|
||||
\ ? 'unchanged'
|
||||
\ : a:response.result.items
|
||||
|
||||
call s:HandleLSPDiagnostics(a:conn_id, l:uri, l:diagnostics)
|
||||
call ale#lsp_linter#HandleLSPDiagnostics(a:conn_id, l:uri, l:diagnostics)
|
||||
elseif l:method is# 'window/showMessage'
|
||||
call ale#lsp_window#HandleShowMessage(
|
||||
\ s:lsp_linter_map[a:conn_id].name,
|
||||
|
||||
Reference in New Issue
Block a user