Skip to content

Commit e9c9b41

Browse files
committed
feat: validate provider names in enabled_providers
1 parent 783f522 commit e9c9b41

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lua/blink/cmp/sources/lib/init.lua

+10
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ function sources.get_enabled_providers(context)
4646
or config.sources.completion.enabled_providers
4747
--- @cast mode_providers string[]
4848

49+
for _, provider in ipairs(mode_providers) do
50+
assert(
51+
sources.providers[provider] ~= nil,
52+
'Requested provider "'
53+
.. provider
54+
.. '" has not been configured. Available providers: '
55+
.. vim.fn.join(vim.tbl_keys(sources.providers), ', ')
56+
)
57+
end
58+
4959
--- @type table<string, blink.cmp.SourceProvider>
5060
local providers = {}
5161
for key, provider in pairs(sources.providers) do

0 commit comments

Comments
 (0)