Add SourceBaseApiParams

This commit is contained in:
hrsh7th
2021-08-25 11:27:14 +09:00
parent 46e5d1656d
commit f7bb6f1c6e
3 changed files with 11 additions and 6 deletions

View File

@@ -186,7 +186,9 @@ end
---@return string
source.get_keyword_pattern = function(self)
if self.source.get_keyword_pattern then
return self.source:get_keyword_pattern()
return self.source:get_keyword_pattern({
option = self:get_option(),
})
end
return config.get().completion.keyword_pattern
end

View File

@@ -37,9 +37,11 @@ cmp.ScrollDirection.Down = 'down'
---@field public buffer fun(c: cmp.ConfigSchema)
---@field public global fun(c: cmp.ConfigSchema)
---@class cmp.CompletionRequest
---@field public context cmp.Context
---@class cmp.SourceBaseApiParams
---@field public option table
---@class cmp.SourceCompletionApiParams : cmp.SourceBaseApiParams
---@field public context cmp.Context
---@field public offset number
---@field public completion_context lsp.CompletionContext