mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-22 17:03:31 +02:00
nvim-lsp: added nvim-cmp completion capabilities (#158)
Co-authored-by: Pedro Alves <pta2002@pta2002.com>
This commit is contained in:
parent
60faa3cf93
commit
bb3721e92d
3 changed files with 26 additions and 2 deletions
|
@ -44,6 +44,12 @@ in {
|
|||
default = "";
|
||||
};
|
||||
|
||||
capabilities = mkOption {
|
||||
type = types.lines;
|
||||
description = "Lua code that modifies inplace the `capabilities` table.";
|
||||
default = "";
|
||||
};
|
||||
|
||||
setupWrappers = mkOption {
|
||||
type = with types; listOf (functionTo str);
|
||||
description = "Code to be run to wrap the setup args. Takes in an argument containing the previous results, and returns a new string of code.";
|
||||
|
@ -78,13 +84,22 @@ in {
|
|||
-- LSP {{{
|
||||
do
|
||||
${cfg.preConfig}
|
||||
|
||||
local __lspServers = ${helpers.toLuaObject cfg.enabledServers}
|
||||
local __lspOnAttach = function(client, bufnr)
|
||||
${cfg.onAttach}
|
||||
end
|
||||
local __lspCapabilities = function()
|
||||
capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
|
||||
${cfg.capabilities}
|
||||
|
||||
return capabilities
|
||||
end
|
||||
|
||||
local __setup = ${runWrappers cfg.setupWrappers "{
|
||||
on_attach = __lspOnAttach
|
||||
on_attach = __lspOnAttach,
|
||||
capabilities = __lspCapabilities()
|
||||
}"}
|
||||
|
||||
for i,server in ipairs(__lspServers) do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue