You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Settings from client and .luarc.json not getting merged #2483
There is no workspace.ignoreDir setting in my client config.
Actual Behaviour
The settings from .luarc.json are not applied. I have to add the ignoreDir setting to my client configuration for it to do something.
Reproduction steps
N/A
Additional Notes
I am testing a Neovim plugin (HiPhish/rainbow-delimiters.nvim), and the test setup requires me to place a symlink to the plugin root directory inside on of its sub-directories (rainbow-delimiters). When the language server starts scanning the plugin directory it ends up running in circles. Adding this directory to the ingoreDir list stops the infinite loop and the language server can scan all files normally.
I cannot place all my settings inside the local .luarc.json because the settings for Neovim configuration and plugin development cannot be known ahead of time, they must be generated. I can place the workspace.ignoreDir setting in my own client configuration, but this won't help people who want to contribute to my plugin.
What I need is for the language server to merge both configurations into one. The order should be from least to most significant:
---@paramclientvim.lsp.Clientlocalfunctionload_local_settings(client)
localroot_dir=client.root_dirifnotroot_dirthenreturnendlocalluarc_path=root_dir.."/.luarc.json"-- Bail out silently if the file does not existifnotvim.uv.fs_stat(luarc_path) thenreturnend-- Read and decode the JSON settings filelocalok, settings=pcall(function()
returnvim.fn.json_decode(vim.fn.readfile(luarc_path))
end)
ifnotokortype(settings) ~="table" thenvim.notify("[lua_ls] Failed to parse .luarc.json", vim.log.levels.WARN)
returnend-- Merge into the client's active settings and notify the serverclient.settings=vim.tbl_deep_extend("force", client.settingsor {}, settings)
client:notify("workspace/didChangeConfiguration", { settings=client.settings })
endvim.lsp.config("lua_ls", {
on_init=load_local_settings,
})
vim.lsp.enable("lua_ls")
Activity
EPadronU commentedon Sep 5, 2026
In case it may help anyone: