Hello,
I can’t seem to setup the indent size for Lua LSP.
I saw this document Lua Language Server | Wiki
I am using Mason and I’ve tried this
return {
{
"williamboman/mason.nvim",
config = true
},
{
"williamboman/mason-lspconfig.nvim",
opts = {
ensure_installed = {
"dockerls",
"html",
"lua_ls",
"ruby_lsp",
"rust_analyzer",
"sqls",
"tailwindcss",
"terraformls",
"ts_ls",
"yamlls",
},
handlers = {
function(server_name)
require("lspconfig")[server_name].setup({})
end,
["lua_ls"] = function ()
local lspconfig = require("lspconfig")
lspconfig.lua_ls.setup {
settings = {
Lua = {
diagnostics = {
-- To avoid undefined global `vim` warnings
globals = { "vim" }
},
format = {
enable = true,
defaultConfig = {
indent_size = "2",
indent_style = "space",
quote_style = "single"
}
}
}
}
}
end,
}
}
}
}