aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2021-12-10 11:55:48 +0100
committerWilliam Boman <william@redwill.se>2021-12-10 11:56:25 +0100
commit454b3609d3622094bdc1c7cadff321a8672ce33f (patch)
treef4f23a03aedab4193c640b17cc78e652953e04d5 /lua
parentfix(angularls): fix --ngProbeLocation (#323) (diff)
downloadmason-454b3609d3622094bdc1c7cadff321a8672ce33f.tar
mason-454b3609d3622094bdc1c7cadff321a8672ce33f.tar.gz
mason-454b3609d3622094bdc1c7cadff321a8672ce33f.tar.bz2
mason-454b3609d3622094bdc1c7cadff321a8672ce33f.tar.lz
mason-454b3609d3622094bdc1c7cadff321a8672ce33f.tar.xz
mason-454b3609d3622094bdc1c7cadff321a8672ce33f.tar.zst
mason-454b3609d3622094bdc1c7cadff321a8672ce33f.zip
fix: increase timeout for sync installs to 60 minutes
Also fix error message when it times out.
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim-lsp-installer.lua20
-rw-r--r--lua/nvim-lsp-installer/installers/context.lua7
2 files changed, 17 insertions, 10 deletions
diff --git a/lua/nvim-lsp-installer.lua b/lua/nvim-lsp-installer.lua
index 0761e257..6d5233a3 100644
--- a/lua/nvim-lsp-installer.lua
+++ b/lua/nvim-lsp-installer.lua
@@ -88,19 +88,21 @@ function M.install_sync(server_identifiers)
end
-- Poll for completion.
- if vim.wait(60000 * 15, function()
+ if not vim.wait(60000 * 15, function()
return #completed_servers >= #server_identifiers
end, 100) then
- if #failed_servers > 0 then
- for _, server in pairs(failed_servers) do
- log.fmt_error("Server %s failed to install.", server.name)
- end
- raise_error(("%d/%d servers failed to install."):format(#failed_servers, #completed_servers))
- end
+ raise_error("Timed out waiting for server(s) to complete installing.")
+ end
- for _, server in pairs(completed_servers) do
- log.fmt_info("Server %s was successfully installed.", server.name)
+ if #failed_servers > 0 then
+ for _, server in pairs(failed_servers) do
+ log.fmt_error("Server %s failed to install.", server.name)
end
+ raise_error(("%d/%d servers failed to install."):format(#failed_servers, #completed_servers))
+ end
+
+ for _, server in pairs(completed_servers) do
+ log.fmt_info("Server %s was successfully installed.", server.name)
end
end
diff --git a/lua/nvim-lsp-installer/installers/context.lua b/lua/nvim-lsp-installer/installers/context.lua
index d76bd6ba..85d3f2a2 100644
--- a/lua/nvim-lsp-installer/installers/context.lua
+++ b/lua/nvim-lsp-installer/installers/context.lua
@@ -206,8 +206,13 @@ end
function M.set_working_dir(rel_path)
---@type ServerInstallerFunction
return vim.schedule_wrap(function(server, callback, context)
- log.fmt_debug("Changing installation working directory for %s", server.name)
local new_dir = path.concat { context.install_dir, rel_path }
+ log.fmt_debug(
+ "Changing installation working directory for %s from %s to %s",
+ server.name,
+ context.install_dir,
+ new_dir
+ )
if not fs.dir_exists(new_dir) then
local ok = pcall(fs.mkdirp, new_dir)
if not ok then