mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +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.";
|
||||
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)
|
||||
${cfg.onAttach}
|
||||
end
|
||||
local __lspCapabilities = function
|
||||
${cfg.capabilities}
|
||||
end
|
||||
|
||||
for i,server in ipairs(__lspServers) do
|
||||
if type(server) == "string" then
|
||||
require('lspconfig')[server].setup {
|
||||
on_attach = __lspOnAttach
|
||||
capabilities = __lspCapabilities
|
||||
}
|
||||
else
|
||||
require('lspconfig')[server.name].setup(server.extraOptions)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue