diff --git a/lua/lazyvim/plugins/extras/ai/copilot.lua b/lua/lazyvim/plugins/extras/ai/copilot.lua index cfe54aa5..fc014fa6 100644 --- a/lua/lazyvim/plugins/extras/ai/copilot.lua +++ b/lua/lazyvim/plugins/extras/ai/copilot.lua @@ -100,9 +100,7 @@ return { dependencies = { "giuxtaposition/blink-cmp-copilot" }, opts = { sources = { - completion = { - enabled_providers = { "copilot" }, - }, + default = { "copilot" }, providers = { copilot = { name = "copilot", diff --git a/lua/lazyvim/plugins/extras/coding/blink.lua b/lua/lazyvim/plugins/extras/coding/blink.lua index ef6a04c7..234ede72 100644 --- a/lua/lazyvim/plugins/extras/coding/blink.lua +++ b/lua/lazyvim/plugins/extras/coding/blink.lua @@ -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", diff --git a/lua/lazyvim/plugins/extras/lang/sql.lua b/lua/lazyvim/plugins/extras/lang/sql.lua index 2e4f881f..075182d6 100644 --- a/lua/lazyvim/plugins/extras/lang/sql.lua +++ b/lua/lazyvim/plugins/extras/lang/sql.lua @@ -130,9 +130,7 @@ return { optional = true, opts = { sources = { - completion = { - enabled_providers = { "dadbod" }, - }, + default = { "dadbod" }, providers = { dadbod = { name = "Dadbod", module = "vim_dadbod_completion.blink" }, },