Improve incomplete handling

This commit is contained in:
hrsh7th
2021-11-24 12:57:04 +09:00
parent ac476e05df
commit 2e4270d028
2 changed files with 11 additions and 11 deletions

View File

@@ -222,7 +222,7 @@ core.complete = function(self, ctx)
end end
self:set_context(ctx) self:set_context(ctx)
for _, s in ipairs(self:get_sources({ source.SourceStatus.WAITING, source.SourceStatus.COMPLETED })) do for _, s in ipairs(self:get_sources()) do
local callback local callback
callback = (function(s_) callback = (function(s_)
return function() return function()

View File

@@ -255,7 +255,7 @@ source.complete = function(self, ctx, callback)
} }
elseif ctx:get_reason() ~= types.cmp.ContextReason.TriggerOnly then elseif ctx:get_reason() ~= types.cmp.ContextReason.TriggerOnly then
if self:get_keyword_length() <= (ctx.cursor.col - offset) then if self:get_keyword_length() <= (ctx.cursor.col - offset) then
if self.incomplete and self.context.cursor.col ~= ctx.cursor.col then if self.incomplete and self.context.cursor.col ~= ctx.cursor.col and self.status ~= source.SourceStatus.FETCHING then
completion_context = { completion_context = {
triggerKind = types.lsp.CompletionTriggerKind.TriggerForIncompleteCompletions, triggerKind = types.lsp.CompletionTriggerKind.TriggerForIncompleteCompletions,
} }