mirror of
https://github.com/dense-analysis/ale.git
synced 2026-09-03 13:26:58 +08:00
fix(lsp): check completionProvider key existence, not emptiness (#5157)
CI / Build (push) Canceled after 0s
CI / Neovim 0.10 Windows (push) Canceled after 0s
CI / Neovim 0.12 Windows (push) Canceled after 0s
CI / Vim 8.2 Windows (push) Canceled after 0s
CI / Vim 9.2 Windows (push) Canceled after 0s
CI / Lint (push) Canceled after 0s
CI / Lua (push) Canceled after 0s
CI / Neovim 0.10 Linux (push) Canceled after 0s
CI / Neovim 0.12 Linux (push) Canceled after 0s
CI / Vim 8.2 Linux (push) Canceled after 0s
CI / Vim 9.2 Linux (push) Canceled after 0s
CI / Build (push) Canceled after 0s
CI / Neovim 0.10 Windows (push) Canceled after 0s
CI / Neovim 0.12 Windows (push) Canceled after 0s
CI / Vim 8.2 Windows (push) Canceled after 0s
CI / Vim 9.2 Windows (push) Canceled after 0s
CI / Lint (push) Canceled after 0s
CI / Lua (push) Canceled after 0s
CI / Neovim 0.10 Linux (push) Canceled after 0s
CI / Neovim 0.12 Linux (push) Canceled after 0s
CI / Vim 8.2 Linux (push) Canceled after 0s
CI / Vim 9.2 Linux (push) Canceled after 0s
completionProvider: {} is valid per the LSP spec (means completion
enabled with default options). The old !empty() check incorrectly
rejected empty objects, causing ALE to silently disable completion
for servers that send completionProvider: {}.
This commit is contained in:
@@ -265,7 +265,9 @@ function! ale#lsp#UpdateCapabilities(conn_id, capabilities) abort
|
|||||||
let l:conn.capabilities.code_actions = 1
|
let l:conn.capabilities.code_actions = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !empty(get(a:capabilities, 'completionProvider'))
|
let l:completion = get(a:capabilities, 'completionProvider', v:false)
|
||||||
|
|
||||||
|
if type(l:completion) is v:t_dict || l:completion is v:true
|
||||||
let l:conn.capabilities.completion = 1
|
let l:conn.capabilities.completion = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user