return { cmd = { vim.env.XDG_DATA_HOME .. "/cargo/bin/emmylua_ls" }, filetypes = { "lua" }, root_markers = { ".emmyrc.json", }, workspace_required = false, on_init = function(client) if client.workspace_folders then local path = client.workspace_folders[1].name if path ~= vim.fn.stdpath("config") and ( vim.uv.fs_stat(path .. "/.luarc.json") or vim.uv.fs_stat(path .. "/.luarc.jsonc") or vim.uv.fs_stat(path .. "/.emmyrc.jsonc") ) then return end end client.config.settings.Lua.workspace = vim.tbl_deep_extend("force", client.config.settings.Lua.workspace, { library = vim.api.nvim_get_runtime_file("", true), }) end, settings = { Lua = { workspace = {} } }, }