Improve incomplete handling
This commit is contained in:
@@ -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()
|
||||||
|
|||||||
@@ -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,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user