From 11c0932efeb1bbba6b6bd637aa4b8cde06a2d0bd Mon Sep 17 00:00:00 2001 From: Micah Halter Date: Mon, 23 Dec 2024 09:50:42 -0500 Subject: [PATCH] fix(blink-cmp): make sure to set up blink LSP capabilities --- .../completion/blink-cmp/init.lua | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/lua/astrocommunity/completion/blink-cmp/init.lua b/lua/astrocommunity/completion/blink-cmp/init.lua index dce786585..caf731f0e 100644 --- a/lua/astrocommunity/completion/blink-cmp/init.lua +++ b/lua/astrocommunity/completion/blink-cmp/init.lua @@ -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 = { [""] = { "show", "show_documentation", "hide_documentation" }, [""] = { "select_prev", "fallback" }, @@ -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, @@ -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