autocomplete.nvim
autocomplete.nvim copied to clipboard
how to handle the lsp.CompletionTriggerKind.TriggerForIncompleteCompletions?
sorry, i donot how to resolve the lsp.CompletionTriggerKind.TriggerForIncompleteCompletions (the completion response type).
could you suggest where i can find how it implented???
For example, if we request a textDocument_completion, we may receive the incomplete result, and we need request with lsp.CompletionTriggerKind.TriggerForIncompleteCompletions again so as to acquire all the completion items
elseif ctx:get_reason() ~= types.cmp.ContextReason.TriggerOnly then
if offset < ctx.cursor.col and self:get_keyword_length() <= (ctx.cursor.col - offset) then
if self.incomplete and self.context.cursor.col ~= ctx.cursor.col and self.status ~= source.SourceStatus.FETCHING then
completion_context = {
triggerKind = types.lsp.CompletionTriggerKind.TriggerForIncompleteCompletions,
}
elseif not vim.tbl_contains({ self.request_offset, self.offset }, offset) then
completion_context = {
triggerKind = types.lsp.CompletionTriggerKind.Invoked,
}
end
else
self:reset() -- Should clear current completion if the TriggerKind isn't TriggerCharacter or Manual and keyword length does not enough.
end
An example case of nvim-cmp
Changed the implementation to use vim native vim.lsp.completion.trigger() so this is now upstream issue if anything