Simplify LSP server configuration

This commit is contained in:
Oliver Davies 2024-03-04 09:31:04 +00:00
parent 9d9ee2ae7a
commit f04a4d385c

View file

@ -71,21 +71,15 @@ end
require("neodev").setup {} require("neodev").setup {}
local servers = { local servers = {
ansiblels = true, ansiblels = {},
bashls = true, bashls = {},
cssls = true, cssls = {},
gopls = true, gopls = {},
grammarly = true, grammarly = {},
html = true, html = {},
rnix = true,
terraformls = true,
tsserver = true,
vuels = true,
intelephense = { intelephense = {
filetypes = { "php", "module", "test", "inc" }, filetypes = { "php", "module", "test", "inc" },
}, },
lua_ls = { lua_ls = {
settings = { settings = {
Lua = { Lua = {
@ -101,7 +95,7 @@ local servers = {
}, },
}, },
}, },
rnix = {},
tailwindcss = { tailwindcss = {
filetypes = { "html", "html.twig", "javascript", "typescript", "vue" }, filetypes = { "html", "html.twig", "javascript", "typescript", "vue" },
@ -111,7 +105,9 @@ local servers = {
}, },
}, },
}, },
terraformls = {},
tsserver = {},
vuels = {},
yamlls = { yamlls = {
settings = { settings = {
yaml = { yaml = {
@ -122,14 +118,6 @@ local servers = {
} }
local setup_server = function(server, config) local setup_server = function(server, config)
if not config then
return
end
if type(config) ~= "table" then
config = {}
end
config = vim.tbl_deep_extend("force", { config = vim.tbl_deep_extend("force", {
on_init = custom_init, on_init = custom_init,
on_attach = custom_attach, on_attach = custom_attach,