Skip to content

Commit

Permalink
fix(blink-cmp): make sure to set up blink LSP capabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter committed Dec 23, 2024
1 parent e20b041 commit 11c0932
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions lua/astrocommunity/completion/blink-cmp/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ return {
opts_extend = { "sources.default", "sources.cmdline" },
opts = {
-- remember to enable your providers here
sources = { default = { "lsp", "path", "snippets", "buffer" } },
sources = {
default = { "lsp", "path", "snippets", "buffer" },
min_keyword_length = function(ctx)
if ctx.mode == "cmdline" and string.find(ctx.line, " ") == nil then return 2 end
return 0
end,
},
keymap = {
["<C-Space>"] = { "show", "show_documentation", "hide_documentation" },
["<Up>"] = { "select_prev", "fallback" },
Expand Down Expand Up @@ -114,6 +120,14 @@ return {
},
},
specs = {
{
"AstroNvim/astrolsp",
optional = true,
opts = function(_, opts)
opts.capabilities =
require("astrocore").extend_tbl(opts.capabilities, require("blink.cmp").get_lsp_capabilities())
end,
},
{
"folke/lazydev.nvim",
optional = true,
Expand All @@ -129,10 +143,6 @@ return {
providers = {
lazydev = { name = "LazyDev", module = "lazydev.integrations.blink", score_offset = 100 },
},
min_keyword_length = function(ctx)
if ctx.mode == "cmdline" and string.find(ctx.line, " ") == nil then return 2 end
return 0
end,
},
})
end
Expand Down

0 comments on commit 11c0932

Please sign in to comment.