mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
Change logic so ALE's LSP implementation and the Neovim LSP client retrieve the language_id for language clients at roughly the same time via the same means. This makes ALE inform the language server what the language for the language is for clients.
22 lines
639 B
Plaintext
22 lines
639 B
Plaintext
Before:
|
|
runtime autoload/ale/lsp.vim
|
|
|
|
let g:conn_id = ale#lsp#Register('executable', '/foo/bar', '', {})
|
|
|
|
" Stub out this function, so we test updating configs.
|
|
function! ale#lsp#Send(conn_id, message) abort
|
|
endfunction
|
|
|
|
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(''), {})
|