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-FR", }, -- set formatter formatters = { ["latexindent"] = { exe = "latexindent", args = { "-sl", "-g /dev/stderr" }, stdin = true, }, }, }, } end }