From 1e98f2f597f71f03bbcf033602f373ca27e67833 Mon Sep 17 00:00:00 2001 From: Builditluc <37375448+Builditluc@users.noreply.github.com> Date: Tue, 23 Nov 2021 15:39:57 +0100 Subject: [PATCH] nvim-lsp: add options --- plugins/nvim-lsp/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/nvim-lsp/default.nix b/plugins/nvim-lsp/default.nix index f3476403..fe697b22 100644 --- a/plugins/nvim-lsp/default.nix +++ b/plugins/nvim-lsp/default.nix @@ -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)