Skip to content

Commit f2f70b4

Browse files
FirelightFlagboykhaneliman
authored andcommitted
blink-cmp: Set lsp capabilities
Co-authored-by: Austin Horstman <[email protected]>
1 parent a5147a3 commit f2f70b4

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

plugins/by-name/blink-cmp/default.nix

+16
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,20 @@ lib.nixvim.plugins.mkNeovimPlugin {
4242
};
4343
signature.enabled = true;
4444
};
45+
46+
extraOptions = {
47+
setupLspCapabilities = lib.nixvim.options.mkEnabledOption "LSP capabilities for blink-cmp";
48+
};
49+
50+
extraConfig = cfg: {
51+
# TODO: On Neovim 0.11+ and Blink.cmp 0.10+ with vim.lsp.config, you may skip this step.
52+
# This is still required when using nvim-lspconfig, until this issue is completed:
53+
# https://github.com/neovim/nvim-lspconfig/issues/3494
54+
plugins.lsp.capabilities =
55+
lib.mkIf cfg.setupLspCapabilities # lua
56+
''
57+
-- Capabilities configuration for blink-cmp
58+
capabilities = require("blink-cmp").get_lsp_capabilities(capabilities)
59+
'';
60+
};
4561
}

tests/test-sources/plugins/by-name/blink-cmp/default.nix

+8
Original file line numberDiff line numberDiff line change
@@ -406,4 +406,12 @@
406406
};
407407
};
408408
};
409+
410+
lsp-compat = {
411+
plugins.blink-cmp = {
412+
enable = true;
413+
setupLspCapabilities = true;
414+
};
415+
plugins.lsp.enable = true;
416+
};
409417
}

0 commit comments

Comments
 (0)