Skip to content

Commit 11c0932

Browse files
committed
fix(blink-cmp): make sure to set up blink LSP capabilities
1 parent e20b041 commit 11c0932

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

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

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,13 @@ return {
4242
opts_extend = { "sources.default", "sources.cmdline" },
4343
opts = {
4444
-- remember to enable your providers here
45-
sources = { default = { "lsp", "path", "snippets", "buffer" } },
45+
sources = {
46+
default = { "lsp", "path", "snippets", "buffer" },
47+
min_keyword_length = function(ctx)
48+
if ctx.mode == "cmdline" and string.find(ctx.line, " ") == nil then return 2 end
49+
return 0
50+
end,
51+
},
4652
keymap = {
4753
["<C-Space>"] = { "show", "show_documentation", "hide_documentation" },
4854
["<Up>"] = { "select_prev", "fallback" },
@@ -114,6 +120,14 @@ return {
114120
},
115121
},
116122
specs = {
123+
{
124+
"AstroNvim/astrolsp",
125+
optional = true,
126+
opts = function(_, opts)
127+
opts.capabilities =
128+
require("astrocore").extend_tbl(opts.capabilities, require("blink.cmp").get_lsp_capabilities())
129+
end,
130+
},
117131
{
118132
"folke/lazydev.nvim",
119133
optional = true,
@@ -129,10 +143,6 @@ return {
129143
providers = {
130144
lazydev = { name = "LazyDev", module = "lazydev.integrations.blink", score_offset = 100 },
131145
},
132-
min_keyword_length = function(ctx)
133-
if ctx.mode == "cmdline" and string.find(ctx.line, " ") == nil then return 2 end
134-
return 0
135-
end,
136146
},
137147
})
138148
end

0 commit comments

Comments
 (0)