fix(blink): config breaking changes. Fixes #4990

This commit is contained in:
Folke Lemaitre
2024-12-11 10:57:07 +01:00
parent 9ad1c49b67
commit 439340bd8a
3 changed files with 13 additions and 19 deletions

View File

@ -100,9 +100,7 @@ return {
dependencies = { "giuxtaposition/blink-cmp-copilot" },
opts = {
sources = {
completion = {
enabled_providers = { "copilot" },
},
default = { "copilot" },
providers = {
copilot = {
name = "copilot",

View File

@ -17,6 +17,7 @@ return {
opts_extend = {
"sources.completion.enabled_providers",
"sources.compat",
"sources.default",
},
dependencies = {
"rafamadriz/friendly-snippets",
@ -70,10 +71,7 @@ return {
-- adding any nvim-cmp sources here will enable them
-- with blink.compat
compat = {},
completion = {
-- remember to enable your providers here
enabled_providers = { "lsp", "path", "snippets", "buffer" },
},
default = { "lsp", "path", "snippets", "buffer" },
},
keymap = {
@ -87,7 +85,7 @@ return {
---@param opts blink.cmp.Config | { sources: { compat: string[] } }
config = function(_, opts)
-- setup compat sources
local enabled = opts.sources.completion.enabled_providers
local enabled = opts.sources.default
for _, source in ipairs(opts.sources.compat or {}) do
opts.sources.providers[source] = vim.tbl_deep_extend(
"force",
@ -99,6 +97,12 @@ return {
end
end
-- TODO: remove when blink made a new release > 0.7.6
if not vim.g.lazyvim_blink_main then
opts.sources.completion = opts.sources.completion or {}
opts.sources.completion.enabled_providers = enabled
end
-- check if we need to override symbol kinds
for _, provider in pairs(opts.sources.providers or {}) do
---@cast provider blink.cmp.SourceProviderConfig|{kind?:string}
@ -136,15 +140,9 @@ return {
"saghen/blink.cmp",
opts = {
sources = {
completion = {
-- add lazydev to your completion providers
enabled_providers = { "lazydev" },
},
-- add lazydev to your completion providers
default = { "lazydev" },
providers = {
lsp = {
-- dont show LuaLS require statements when lazydev has items
fallback_for = { "lazydev" },
},
lazydev = {
name = "LazyDev",
module = "lazydev.integrations.blink",

View File

@ -130,9 +130,7 @@ return {
optional = true,
opts = {
sources = {
completion = {
enabled_providers = { "dadbod" },
},
default = { "dadbod" },
providers = {
dadbod = { name = "Dadbod", module = "vim_dadbod_completion.blink" },
},