Skip to content

Commit 2e2784a

Browse files
committed
fix(blink-cmp): check for the existence of lazydev blink integration support
1 parent 580686c commit 2e2784a

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

lua/astrocommunity/completion/blink-cmp/init.lua

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,21 @@ return {
7272
specs = {
7373
{
7474
"Saghen/blink.cmp",
75-
opts = {
76-
sources = {
77-
-- add lazydev to your completion providers
78-
completion = { enabled_providers = { "lazydev" } },
79-
providers = {
80-
-- dont show LuaLS require statements when lazydev has items
81-
lsp = { fallback_for = { "lazydev" } },
82-
lazydev = { name = "LazyDev", module = "lazydev.integrations.blink" },
83-
},
84-
},
85-
},
75+
opts = function(_, opts)
76+
if pcall(require, "lazydev.integrations.blink") then
77+
return require("astrocore").extend_tbl(opts, {
78+
sources = {
79+
-- add lazydev to your completion providers
80+
completion = { enabled_providers = { "lazydev" } },
81+
providers = {
82+
-- dont show LuaLS require statements when lazydev has items
83+
lsp = { fallback_for = { "lazydev" } },
84+
lazydev = { name = "LazyDev", module = "lazydev.integrations.blink" },
85+
},
86+
},
87+
})
88+
end
89+
end,
8690
},
8791
},
8892
},

0 commit comments

Comments
 (0)