Skip to content

Commit

Permalink
blink-cmp: Set lsp capabilities
Browse files Browse the repository at this point in the history
Co-authored-by: Austin Horstman <[email protected]>
  • Loading branch information
2 people authored and nix-infra-bot committed Feb 7, 2025
1 parent a5147a3 commit f2f70b4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
16 changes: 16 additions & 0 deletions plugins/by-name/blink-cmp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,20 @@ lib.nixvim.plugins.mkNeovimPlugin {
};
signature.enabled = true;
};

extraOptions = {
setupLspCapabilities = lib.nixvim.options.mkEnabledOption "LSP capabilities for blink-cmp";
};

extraConfig = cfg: {
# TODO: On Neovim 0.11+ and Blink.cmp 0.10+ with vim.lsp.config, you may skip this step.
# This is still required when using nvim-lspconfig, until this issue is completed:
# https://github.com/neovim/nvim-lspconfig/issues/3494
plugins.lsp.capabilities =
lib.mkIf cfg.setupLspCapabilities # lua
''
-- Capabilities configuration for blink-cmp
capabilities = require("blink-cmp").get_lsp_capabilities(capabilities)
'';
};
}
8 changes: 8 additions & 0 deletions tests/test-sources/plugins/by-name/blink-cmp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -406,4 +406,12 @@
};
};
};

lsp-compat = {
plugins.blink-cmp = {
enable = true;
setupLspCapabilities = true;
};
plugins.lsp.enable = true;
};
}

0 comments on commit f2f70b4

Please sign in to comment.