diff --git a/lua/care/core.lua b/lua/care/core.lua index 05ad69b..c23ba2d 100644 --- a/lua/care/core.lua +++ b/lua/care/core.lua @@ -31,7 +31,7 @@ function Core:complete(reason, source_filter) self.context.reason = reason local offset = self.context.cursor.col for i, source in ipairs(sources) do - if source.source.is_available() and source:is_enabled() then + if source.source:is_available() and source:is_enabled() then require("care.sources").complete(self.context, source, function(items, is_incomplete) source.incomplete = is_incomplete or false source.entries = items diff --git a/lua/care/types/source.lua b/lua/care/types/source.lua index 5472516..9ad2b7f 100644 --- a/lua/care/types/source.lua +++ b/lua/care/types/source.lua @@ -16,7 +16,7 @@ --- --- This function will be called quite often so developers should try to keep it more or less --- performant. This won't be an issue in the vast majority of cases though. ----@field is_available? fun(): boolean +---@field is_available? fun(self: care.source): boolean --- This is a function used to get additional details for completion items. This is especially --- important for the lsp source which needs to send the `completionItem/resolve` request. --- Resolving completion items is used for performance reasons so e.g. the documentation for an item