1
0
Fork 0

lsp: lua_ls

This commit is contained in:
Felipe 2023-04-18 01:46:22 -04:00
parent 778106c705
commit 80cf9083d3
Signed by: pitbuster
SSH key fingerprint: SHA256:HDYu2Pm4/TmSX8GBwV49UvFWr1Ljg8XlHxKeCpjJpOk

View file

@ -153,6 +153,18 @@ local servers = {
gopls = {},
jsonls = {},
kotlin_language_server = {},
lua_ls = {
settings = {
Lua = {
runtime = { version = "LuaJIT" },
diagnostics = { globals = { "vim" } },
workspace = {
library = vim.api.nvim_get_runtime_file("", true),
},
telemetry = { enable = false },
},
},
},
marksman = {},
pylsp = {},
rust_analyzer = {},
@ -166,10 +178,17 @@ local servers = {
-- Auto format on save
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
callback = function()
if next(vim.lsp.get_active_clients()) == nil then
cmd("Format")
else
local lsp_format = false
for _, client in pairs(vim.lsp.get_active_clients({ bufnr = 0 })) do
if client.server_capabilities.documentFormattingProvider then
lsp_format = true
break
end
end
if lsp_format then
vim.lsp.buf.format({ async = false })
else
cmd("Format")
end
end,
})
@ -215,7 +234,7 @@ lint.linters.yamllint.args = {
args = { "--format=parsable", "-d relaxed" },
}
linters = {
local linters = {
bash = { "shellcheck" },
dockerfile = { "hadolint" },
go = { "golangcilint" },