mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
nvim-lsp: add options
This commit is contained in:
parent
aa78a78331
commit
1e98f2f597
1 changed files with 10 additions and 0 deletions
|
@ -38,6 +38,12 @@ in
|
||||||
description = "A lua function to be run when a new LSP buffer is attached. The argument `client` is provided.";
|
description = "A lua function to be run when a new LSP buffer is attached. The argument `client` is provided.";
|
||||||
default = "";
|
default = "";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
capabilities = mkOption {
|
||||||
|
type = types.lines;
|
||||||
|
description = "A lua function defining the capabilities of a new LSP buffer.";
|
||||||
|
default = "";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -52,11 +58,15 @@ in
|
||||||
local __lspOnAttach = function(client)
|
local __lspOnAttach = function(client)
|
||||||
${cfg.onAttach}
|
${cfg.onAttach}
|
||||||
end
|
end
|
||||||
|
local __lspCapabilities = function
|
||||||
|
${cfg.capabilities}
|
||||||
|
end
|
||||||
|
|
||||||
for i,server in ipairs(__lspServers) do
|
for i,server in ipairs(__lspServers) do
|
||||||
if type(server) == "string" then
|
if type(server) == "string" then
|
||||||
require('lspconfig')[server].setup {
|
require('lspconfig')[server].setup {
|
||||||
on_attach = __lspOnAttach
|
on_attach = __lspOnAttach
|
||||||
|
capabilities = __lspCapabilities
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
require('lspconfig')[server.name].setup(server.extraOptions)
|
require('lspconfig')[server.name].setup(server.extraOptions)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue