Close #3600 - Implement pull diagnostics in VimL

Implement pull diagnostics in the VimL implementation so ALE is able
to track when servers are busy checking files. Only servers that
support this feature will return diagnostics these ways.
This commit is contained in:
w0rp
2025-03-23 14:37:04 +00:00
parent 26ffb9dfa3
commit f90e72ae1f
9 changed files with 248 additions and 27 deletions

View File

@@ -47,6 +47,7 @@ function! ale#lsp#Register(executable_or_address, project, language, init_option
\ 'definition': 0,
\ 'typeDefinition': 0,
\ 'implementation': 0,
\ 'pull_model': 0,
\ 'symbol_search': 0,
\ 'code_actions': 0,
\ 'did_save': 0,
@@ -276,6 +277,13 @@ function! ale#lsp#UpdateCapabilities(conn_id, capabilities) abort
let l:conn.capabilities.implementation = 1
endif
" Check if the language server supports pull model diagnostics.
if type(get(a:capabilities, 'diagnosticProvider')) is v:t_dict
if type(get(a:capabilities.diagnosticProvider, 'interFileDependencies')) is v:t_bool
let l:conn.capabilities.pull_model = 1
endif
endif
if get(a:capabilities, 'workspaceSymbolProvider') is v:true
let l:conn.capabilities.symbol_search = 1
endif
@@ -486,6 +494,10 @@ function! s:SendInitMessage(conn) abort
\ 'dynamicRegistration': v:false,
\ 'linkSupport': v:false,
\ },
\ 'diagnostic': {
\ 'dynamicRegistration': v:true,
\ 'relatedDocumentSupport': v:true,
\ },
\ 'publishDiagnostics': {
\ 'relatedInformation': v:true,
\ },