nvim/lua/configs/lspconfig.lua
2023-09-11 09:46:48 +02:00

62 lines
1.7 KiB
Lua

require("mason-lspconfig").setup_handlers {
-- The first entry (without a key) will be the default handler
-- and will be called for each installed server that doesn't have
-- a dedicated handler.
function(server_name) -- default handler (optional)
require("lspconfig")[server_name].setup {}
end,
-- Next, you can provide a dedicated handler for specific servers.
-- For example, a handler override for the `rust_analyzer`:
-- ["rust_analyzer"] = function ()
-- require("rust-tools").setup {}
-- end
["lua_ls"] = function()
require("lspconfig").lua_ls.setup {
settings = {
Lua = {
diagnostics = {
globals = { "vim" },
},
workspace = {
library = {
[vim.fn.expand "$VIMRUNTIME/lua"] = true,
[vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true,
[vim.fn.stdpath "data" .. "/lazy/extensions/nvchad_types"] = true,
[vim.fn.stdpath "data" .. "/lazy/lazy.nvim/lua/lazy"] = true,
},
maxPreload = 100000,
preloadFileSize = 10000,
},
},
},
}
end,
["ltex"] = function()
require("lspconfig").ltex.setup {
settings = {
ltex = {
language = "fr",
checkFrequency = "save"
},
-- set formatter
formatters = {
["latexindent"] = {
exe = "latexindent",
args = { "-sl", "-g /dev/stderr" },
stdin = true,
},
},
},
}
end
}
vim.diagnostic.config({
virtual_text = false,
-- signs = true,
-- underline = true,
-- update_in_insert = false,
-- severity_sort = false,
})