From 56f7cb679ef9e5c09351bfa67b081c68ad27349f Mon Sep 17 00:00:00 2001 From: Liam Dyer Date: Wed, 27 Nov 2024 22:35:15 -0500 Subject: [PATCH] fix: invalid configuration and readme after refactor Closes #394 --- README.md | 10 +++++----- lua/blink/cmp/config/keymap.lua | 2 +- lua/blink/cmp/config/sources.lua | 4 ++-- lua/blink/cmp/keymap/presets.lua | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 16c94bea..96bdddae 100644 --- a/README.md +++ b/README.md @@ -217,7 +217,7 @@ MiniDeps.add({ -- -- [''] = { -- function(cmp) - -- if cmp.is_in_snippet() then return cmp.accept() + -- if cmp.snippet_active() then return cmp.accept() -- else return cmp.select_and_accept() end -- end, -- 'snippet_forward', @@ -383,7 +383,7 @@ MiniDeps.add({ ellipsis = false, text = function(ctx) return ctx.kind_icon .. ctx.icon_gap end, highlight = function(ctx) - return require('blink.cmp.lib.utils').get_tailwind_hl(ctx) or 'BlinkCmpKind' .. ctx.kind + return require('blink.cmp.completion.windows.render.tailwind').get_hl(ctx) or 'BlinkCmpKind' .. ctx.kind end, }, @@ -392,7 +392,7 @@ MiniDeps.add({ width = { fill = true }, text = function(ctx) return ctx.kind end, highlight = function(ctx) - return require('blink.cmp.lib.utils').get_tailwind_hl(ctx) or 'BlinkCmpKind' .. ctx.kind + return require('blink.cmp.completion.windows.render.tailwind').get_hl(ctx) or 'BlinkCmpKind' .. ctx.kind end, }, @@ -757,7 +757,7 @@ completion.menu.draw = { ellipsis = false, text = function(ctx) return ctx.kind_icon .. ctx.icon_gap end, highlight = function(ctx) - return require('blink.cmp.lib.utils').get_tailwind_hl(ctx) or 'BlinkCmpKind' .. ctx.kind + return require('blink.cmp.completion.windows.render.tailwind').get_hl(ctx) or 'BlinkCmpKind' .. ctx.kind end, }, @@ -766,7 +766,7 @@ completion.menu.draw = { width = { fill = true }, text = function(ctx) return ctx.kind end, highlight = function(ctx) - return require('blink.cmp.lib.utils').get_tailwind_hl(ctx) or 'BlinkCmpKind' .. ctx.kind + return require('blink.cmp.completion.windows.render.tailwind').get_hl(ctx) or 'BlinkCmpKind' .. ctx.kind end, }, diff --git a/lua/blink/cmp/config/keymap.lua b/lua/blink/cmp/config/keymap.lua index 6aed00ec..f7167392 100644 --- a/lua/blink/cmp/config/keymap.lua +++ b/lua/blink/cmp/config/keymap.lua @@ -43,7 +43,7 @@ --- --- [''] = { --- function(cmp) ---- if cmp.is_in_snippet() then return cmp.accept() +--- if cmp.snippet_active() then return cmp.accept() --- else return cmp.select_and_accept() end --- end, --- 'snippet_forward', diff --git a/lua/blink/cmp/config/sources.lua b/lua/blink/cmp/config/sources.lua index 044c020a..f082c4d3 100644 --- a/lua/blink/cmp/config/sources.lua +++ b/lua/blink/cmp/config/sources.lua @@ -71,13 +71,13 @@ function sources.validate(config) providers = { config.providers, 'table' }, }) validate('sources.completion', { - enabled_providers = { config.completion.enabled_providers, 'table' }, + enabled_providers = { config.completion.enabled_providers, { 'table', 'function' } }, }) for key, provider in pairs(config.providers) do validate('sources.providers.' .. key, { name = { provider.name, 'string' }, module = { provider.module, 'string' }, - enabled = { provider.enabled, 'boolean', true }, + enabled = { provider.enabled, { 'boolean', 'function' }, true }, opts = { provider.opts, 'table', true }, transform_items = { provider.transform_items, 'function', true }, should_show_items = { provider.should_show_items, { 'boolean', 'function' }, true }, diff --git a/lua/blink/cmp/keymap/presets.lua b/lua/blink/cmp/keymap/presets.lua index 212c9081..68784f19 100644 --- a/lua/blink/cmp/keymap/presets.lua +++ b/lua/blink/cmp/keymap/presets.lua @@ -22,7 +22,7 @@ local presets = { [''] = { function(cmp) - if cmp.is_in_snippet() then + if cmp.snippet_active() then return cmp.accept() else return cmp.select_and_accept()