mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-27 21:32:18 +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:
@@ -7,6 +7,7 @@ Before:
|
||||
\ 'initialized': 0,
|
||||
\ 'init_request_id': 0,
|
||||
\ 'init_options': {},
|
||||
\ 'config': {},
|
||||
\ 'callback_list': [],
|
||||
\ 'message_queue': [],
|
||||
\ 'capabilities_queue': [],
|
||||
|
||||
17
test/lsp/test_update_config.vader
Normal file
17
test/lsp/test_update_config.vader
Normal file
@@ -0,0 +1,17 @@
|
||||
Before:
|
||||
runtime autoload/ale/lsp.vim
|
||||
|
||||
let g:conn_id = ale#lsp#Register('executable', '/foo/bar', {})
|
||||
|
||||
After:
|
||||
Restore
|
||||
|
||||
unlet! g:conn_id
|
||||
|
||||
runtime autoload/ale/lsp.vim
|
||||
|
||||
Execute(Only send updates when the configuration dictionary changes):
|
||||
AssertEqual 0, ale#lsp#UpdateConfig(g:conn_id, bufnr(''), {})
|
||||
AssertEqual 1, ale#lsp#UpdateConfig(g:conn_id, bufnr(''), {'a': 1})
|
||||
AssertEqual 0, ale#lsp#UpdateConfig(g:conn_id, bufnr(''), {'a': 1})
|
||||
AssertEqual 1, ale#lsp#UpdateConfig(g:conn_id, bufnr(''), {})
|
||||
Reference in New Issue
Block a user