Sync volume mounts with LSP root directory
mainWhen a language server requires the root_dir path to be synced with the Docker container's internal path, use the on_new_config hook in lspconfig. This ensures that whenever a new root directory is detected, the lspcontainers.command is re-generated with the correct root_dir context.
local server = "lua_ls"
require'lspconfig'[server].setup{
on_new_config = function(new_config, new_root_dir)
new_config.cmd = require'lspcontainers'.command(server, { root_dir = new_root_dir })
end
}