1
Fork 0
satellite/home/features/neovim/plugins/lspconfig.lua

29 lines
551 B
Lua
Raw Permalink Normal View History

2024-03-09 16:57:38 +01:00
local M = {}
2023-01-10 02:38:06 +01:00
2024-02-24 01:53:32 +01:00
-- {{{ Capabilities
M.capabilities = function()
local c = require("cmp_nvim_lsp").default_capabilities()
2024-02-24 01:53:32 +01:00
-- Add folding capabilities
c.textDocument.foldingRange = {
dynamicRegistration = false,
lineFoldingOnly = true,
}
return c
end
-- }}}
-- {{{ Main config function
2024-07-28 20:01:45 +02:00
function M.config(servers)
2024-02-24 01:53:32 +01:00
local lspconfig = require("lspconfig")
2023-01-10 02:38:06 +01:00
local capabilities = M.capabilities()
for lsp, details in pairs(servers) do
details.capabilities = capabilities
2024-02-24 01:53:32 +01:00
lspconfig[lsp].setup(details)
2023-01-10 02:38:06 +01:00
end
2024-01-01 21:24:04 +01:00
end
2023-01-10 02:38:06 +01:00
--}}}
return M