Getting more lsp's configured

This commit is contained in:
tobias 2025-04-30 17:57:19 +02:00
parent 11295dd921
commit d1f6f2fbfd

View File

@ -28,6 +28,8 @@ return {
ensure_installed = { ensure_installed = {
"lua_ls", "lua_ls",
"ansiblels", "ansiblels",
"terraformls",
"pylsp",
}, },
handlers = { handlers = {
function(server_name) -- default handler (optional) function(server_name) -- default handler (optional)
@ -48,7 +50,7 @@ return {
executionEnvironment = { enabled = false }, executionEnvironment = { enabled = false },
validation = { validation = {
enabled = false, enabled = false,
lint = { enabled = true, path = 'ansible-lint' }, -- lint = { enabled = true, path = 'ansible-lint' },
}, },
}, },
}, },
@ -58,6 +60,26 @@ return {
}) })
end, end,
["pylsp"] = function ()
local lspconfig = require("lspconfig")
lspconfig["pylsp"].setup({
cmd = {"pylsp"},
filetypes = { 'py' },
root_dir = lspconfig.util.root_pattern("Documents"),
single_file_support = false,
})
end,
["terraformls"] = function ()
local lspconfig = require("lspconfig")
lspconfig["terraformls"].setup({
cmd = {"terraform-ls", "server"},
filetypes = { 'terraform', 'terraform-vars', 'tf', 'hcl' },
root_dir = lspconfig.util.root_pattern("Documents"),
single_file_support = false,
})
end,
["lua_ls"] = function() ["lua_ls"] = function()
local lspconfig = require("lspconfig") local lspconfig = require("lspconfig")
@ -109,4 +131,4 @@ return {
}, },
}) })
end end
} }