From 55bdb077b7069c018cc5ccf682417770abec5b4a Mon Sep 17 00:00:00 2001 From: glepnir Date: Tue, 11 Mar 2025 20:05:36 +0800 Subject: 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. --- runtime/lua/vim/lsp/completion.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/lua/vim/lsp/completion.lua b/runtime/lua/vim/lsp/completion.lua index 675921638d..4064e02597 100644 --- a/runtime/lua/vim/lsp/completion.lua +++ b/runtime/lua/vim/lsp/completion.lua @@ -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 -- cgit