mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-11 18:04:32 +02:00
fix(blink): better compat
This commit is contained in:
parent
25eacd32ac
commit
624f61e383
1 changed files with 10 additions and 8 deletions
|
@ -73,16 +73,18 @@ return {
|
|||
},
|
||||
},
|
||||
},
|
||||
---@param opts blink.cmp.Config
|
||||
---@param opts blink.cmp.Config | { sources: { compat: string[] } }
|
||||
config = function(_, opts)
|
||||
-- setup compat sources
|
||||
local enabled = opts.sources.completion.enabled_providers
|
||||
for _, source in ipairs(opts.sources.compat or {}) do
|
||||
opts.sources.providers[source] = opts.sources.providers[source]
|
||||
or {
|
||||
name = source,
|
||||
module = "blink.compat.source",
|
||||
}
|
||||
if not vim.tbl_contains(opts.sources.completion.enabled_providers, source) then
|
||||
table.insert(opts.sources.completion.enabled_providers, source)
|
||||
opts.sources.providers[source] = vim.tbl_deep_extend(
|
||||
"force",
|
||||
{ name = source, module = "blink.compat.source" },
|
||||
opts.sources.providers[source] or {}
|
||||
)
|
||||
if type(enabled) == "table" and not vim.tbl_contains(enabled, source) then
|
||||
table.insert(enabled, source)
|
||||
end
|
||||
end
|
||||
require("blink.cmp").setup(opts)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue