mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-10 13:32:34 +08:00
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:
@@ -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,
|
||||
\ },
|
||||
|
||||
Reference in New Issue
Block a user