fix(lsp): wrapped ctx in opts before passed to vim.lsp.completion.trigger #32837

Problem: ctx is passed directly to M.trigger. In fact, it is a field of opts.

Solution: wrapped in a table and passed to M.trigger.
This commit is contained in:
glepnir
2025-03-11 20:05:36 +08:00
committed by GitHub
parent b750dee0a5
commit 55bdb077b7

View File

@@ -536,7 +536,7 @@ local function on_insert_char_pre(handle)
local ctx = { triggerKind = protocol.CompletionTriggerKind.TriggerForIncompleteCompletions } local ctx = { triggerKind = protocol.CompletionTriggerKind.TriggerForIncompleteCompletions }
if debounce_ms == 0 then if debounce_ms == 0 then
vim.schedule(function() vim.schedule(function()
M.trigger(ctx) M.trigger({ ctx = ctx })
end) end)
else else
completion_timer = new_timer() completion_timer = new_timer()
@@ -544,7 +544,7 @@ local function on_insert_char_pre(handle)
debounce_ms, debounce_ms,
0, 0,
vim.schedule_wrap(function() vim.schedule_wrap(function()
M.trigger(ctx) M.trigger({ ctx = ctx })
end) end)
) )
end end