diff --git a/lua/blink/cmp/sources/lsp/completion.lua b/lua/blink/cmp/sources/lsp/completion.lua index 4a0ff619..5d542806 100644 --- a/lua/blink/cmp/sources/lsp/completion.lua +++ b/lua/blink/cmp/sources/lsp/completion.lua @@ -9,7 +9,10 @@ local CompletionTriggerKind = vim.lsp.protocol.CompletionTriggerKind local completion = {} -function completion.get_completion_for_client(client, context) +--- @param context blink.cmp.Context +--- @param client vim.lsp.Client +--- @return blink.cmp.Task +function completion.get_completion_for_client(context, client) return async.task.new(function(resolve) local params = vim.lsp.util.make_position_params(0, client.offset_encoding) params.context = { diff --git a/lua/blink/cmp/sources/lsp/init.lua b/lua/blink/cmp/sources/lsp/init.lua index 01a72a40..4dbfd8f0 100644 --- a/lua/blink/cmp/sources/lsp/init.lua +++ b/lua/blink/cmp/sources/lsp/init.lua @@ -34,7 +34,7 @@ function lsp:get_completions(context, callback) -- TODO: implement a timeout before returning the menu as-is. In the future, it would be neat -- to detect slow LSPs and consistently run them async local task = async.task - .await_all(vim.tbl_map(function(client) return completion_lib.get_completion_for_client(client, context) end, clients)) + .await_all(vim.tbl_map(function(client) return completion_lib.get_completion_for_client(context, client) end, clients)) :map(function(responses) local final = { is_incomplete_forward = false, is_incomplete_backward = false, items = {} } for _, response in ipairs(responses) do