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 authored and GitHub committed 2025-03-11 05:05:36 -07:00
1 parent b750dee0a5
commit 55bdb077b7
1 file changed
+2 -2
+2 -2
View File
@@ -536,7 +536,7 @@ local function on_insert_char_pre(handle)
local ctx = { triggerKind = protocol.CompletionTriggerKind.TriggerForIncompleteCompletions }
if debounce_ms == 0 then
vim.schedule(function()
M.trigger(ctx)
M.trigger({ ctx = ctx })
end)
else
completion_timer = new_timer()
@@ -544,7 +544,7 @@ local function on_insert_char_pre(handle)
debounce_ms,
0,
vim.schedule_wrap(function()
M.trigger(ctx)
M.trigger({ ctx = ctx })
end)
)
end