Skip to content

Commit

Permalink
feat: pass source to is_available
Browse files Browse the repository at this point in the history
fixes #141
  • Loading branch information
max397574 committed Nov 24, 2024
1 parent d49877a commit 7adabf5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lua/care/core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lua/care/types/source.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7adabf5

Please sign in to comment.