-- spec: https://luals.github.io/wiki/settings/ local utils = require("utils") ---@type ServerConfig return { enable = true, dependencies = { "cargo" }, mason = { "lua-language-server", post_install = { { cmd = { "cargo", "install", "stylua", "--features", "lua54" } } }, }, keymaps = { { mode = "n", lhs = "lf", rhs = function() utils.format({ cmd = { "stylua", "-" }, stdin = true, stdout = true, }) end, }, { mode = "x", lhs = "lf", rhs = function() utils.format({ cmd = { "stylua", "-", "--range-start", "%byte_start%", "--range-end", "%byte_end%", }, stdin = true, stdout = true, }) end, }, }, lspconfig = { filetypes = { "lua" }, cmd = { "lua-language-server" }, single_file_support = true, settings = { Lua = { completion = { showWord = "Disable" }, diagnostics = { -- disable = { "missing-fields" }, }, runtime = { version = "LuaJIT", path = { -- "?.lua", "?.lua", "?/init.lua", -- "?.lua", -- "lua/?.lua", -- "lua/?/init.lua", -- "?/lua/?.lua", -- "?/lua/?/init.lua", }, -- pathStrict = true, }, workspace = { library = { vim.env.VIMRUNTIME, "~/repos/awesome-code-doc", "/usr/share/awesome/lib", vim.fn.stdpath("data") .. "/lazy", }, checkThirdParty = false, }, hint = { enable = false, arrayIndex = "Disable", await = true, paramName = "All", paramType = true, semicolon = "Disable", setType = true, }, telemetry = { enable = false }, }, }, }, }