mirror of
https://github.com/dense-analysis/ale.git
synced 2026-08-13 19:30:59 +08:00
Only send LSP config updates when the dict changes
Each LSP connection now stores its configuration dictionary. It is
initially empty (`{}`) and is updated each time the LSP connection is
started. When a change is detected, the workspace/didChangeConfiguration
message is sent to the LSP servers with the updated configuration.
This commit is contained in:
@@ -201,13 +201,6 @@ function! ale#lsp_linter#StartLSP(buffer, linter) abort
|
||||
endif
|
||||
|
||||
let l:config = ale#lsp_linter#GetConfig(a:buffer, a:linter)
|
||||
|
||||
if !empty(l:config)
|
||||
" set LSP configuration options (workspace/didChangeConfiguration)
|
||||
let l:config_message = ale#lsp#message#DidChangeConfiguration(a:buffer, l:config)
|
||||
call ale#lsp#Send(l:conn_id, l:config_message)
|
||||
endif
|
||||
|
||||
let l:language_id = ale#util#GetFunction(a:linter.language_callback)(a:buffer)
|
||||
|
||||
let l:details = {
|
||||
@@ -218,6 +211,8 @@ function! ale#lsp_linter#StartLSP(buffer, linter) abort
|
||||
\ 'language_id': l:language_id,
|
||||
\}
|
||||
|
||||
call ale#lsp#UpdateConfig(l:conn_id, a:buffer, l:config)
|
||||
|
||||
if ale#lsp#OpenDocument(l:conn_id, a:buffer, l:language_id)
|
||||
if g:ale_history_enabled && !empty(l:command)
|
||||
call ale#history#Add(a:buffer, 'started', l:conn_id, l:command)
|
||||
|
||||
Reference in New Issue
Block a user