mirror of
https://github.com/neovim/neovim.git
synced 2026-04-30 03:04:13 +00:00
fix(lsp): error on omnifunc completion (#37790)
Problem:
After eaacdc9, complete with emmylua_ls error with:
runtime/lua/vim/lsp/completion.lua:586: attempt to get length of field
'items' (a nil value)
Solution:
Result can be CompletionItem[] according the spec:
> If a `CompletionItem[]` is provided, it is interpreted to be complete,
> so it is the same as `{ isIncomplete: false, items }`
This commit is contained in:
@@ -583,7 +583,7 @@ local function trigger(bufnr, clients, ctx)
|
||||
end
|
||||
|
||||
local result = response.result
|
||||
if result and #result.items > 0 then
|
||||
if result and #(result.items or result) > 0 then
|
||||
Context.isIncomplete = Context.isIncomplete or result.isIncomplete
|
||||
local encoding = client and client.offset_encoding or 'utf-16'
|
||||
local client_matches, tmp_server_start_boundary
|
||||
|
||||
Reference in New Issue
Block a user