Skip to content

Commit

Permalink
Add isRetrigger: true to context
Browse files Browse the repository at this point in the history
This fixes issue with csharp lsp

Signed-off-by: Tomas Slusny <[email protected]>
  • Loading branch information
deathbeam committed Sep 16, 2024
1 parent f600445 commit 1304548
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/autocomplete/buffer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ end

local function complete_lsp(bufnr, prefix, cmp_start, client, char)
local context = {
isRetrigger = true,
triggerKind = vim.lsp.protocol.CompletionTriggerKind.Invoked,
triggerCharacter = '',
}
Expand All @@ -97,6 +98,7 @@ local function complete_lsp(bufnr, prefix, cmp_start, client, char)
)
then
context = {
isRetrigger = true,
triggerKind = vim.lsp.protocol.CompletionTriggerKind.TriggerCharacter,
triggerCharacter = char,
}
Expand All @@ -108,7 +110,7 @@ local function complete_lsp(bufnr, prefix, cmp_start, client, char)
return util.request(client, methods.textDocument_completion, params, function(result)
-- FIXME: Maybe dont use interal lsp functions? Idk why its not exposed and the parent method is marked as deprecated
local items = vim.lsp.completion._lsp_to_complete_items(result, prefix)
complete('', cmp_start, items)
complete(prefix, cmp_start, items)
end, bufnr)
end

Expand Down
1 change: 1 addition & 0 deletions lua/autocomplete/signature.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ local function cursor_moved(args)
client.offset_encoding
)
params.context = {
isRetrigger = true,
triggerKind = vim.lsp.protocol.CompletionTriggerKind.TriggerCharacter,
triggerCharacter = c,
}
Expand Down

0 comments on commit 1304548

Please sign in to comment.