This commit is contained in:
hrsh7th
2021-09-19 01:49:07 +09:00
parent 7bfa33a8db
commit b99d7292b0

View File

@@ -314,10 +314,12 @@ source.complete = function(self, ctx, callback)
self.incomplete = response.isIncomplete or false self.incomplete = response.isIncomplete or false
self.entries = {} self.entries = {}
for i, item in ipairs(response.items or response) do for i, item in ipairs(response.items or response) do
if (misc.safe(item) or {}).label then
local e = entry.new(ctx, self, item) local e = entry.new(ctx, self, item)
self.entries[i] = e self.entries[i] = e
self.offset = math.min(self.offset, e:get_offset()) self.offset = math.min(self.offset, e:get_offset())
end end
end
else else
debug.log(self:get_debug_name(), 'continue', 'nil') debug.log(self:get_debug_name(), 'continue', 'nil')
if completion_context.triggerKind == types.lsp.CompletionTriggerKind.TriggerCharacter then if completion_context.triggerKind == types.lsp.CompletionTriggerKind.TriggerCharacter then