diff options
| author | William Boman <william@redwill.se> | 2021-12-23 11:08:35 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-23 11:08:35 +0100 |
| commit | d39847e7b4d89b335e986e6931cfa8ae0d5911a8 (patch) | |
| tree | af3a6177e423736bd0cc9f5bf28310c9529972c1 /lua/nvim-lsp-installer/installers/init.lua | |
| parent | feat: add grammarly (#349) (diff) | |
| download | mason-d39847e7b4d89b335e986e6931cfa8ae0d5911a8.tar mason-d39847e7b4d89b335e986e6931cfa8ae0d5911a8.tar.gz mason-d39847e7b4d89b335e986e6931cfa8ae0d5911a8.tar.bz2 mason-d39847e7b4d89b335e986e6931cfa8ae0d5911a8.tar.lz mason-d39847e7b4d89b335e986e6931cfa8ae0d5911a8.tar.xz mason-d39847e7b4d89b335e986e6931cfa8ae0d5911a8.tar.zst mason-d39847e7b4d89b335e986e6931cfa8ae0d5911a8.zip | |
fix(ccls): better Mac support (#352)
This is a breaking change due to fundamental changes to the
installer. Re-installation will unfortunately be required.
Diffstat (limited to 'lua/nvim-lsp-installer/installers/init.lua')
| -rw-r--r-- | lua/nvim-lsp-installer/installers/init.lua | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/lua/nvim-lsp-installer/installers/init.lua b/lua/nvim-lsp-installer/installers/init.lua index c4ac2747..ab9ad4f9 100644 --- a/lua/nvim-lsp-installer/installers/init.lua +++ b/lua/nvim-lsp-installer/installers/init.lua @@ -21,6 +21,7 @@ end ---@field stdio_sink StdioSink ---@field github_release_file string|nil @Only available if context.use_github_release_file has been called. ---@field os_distribution table<string, any> @Only available if context.use_os_distribution has been called. +---@field homebrew_prefix string @Only available if context.use_homebrew_prefix has been called. ---@field install_dir string ---@alias ServerInstallerFunction fun(server: Server, callback: ServerInstallCallback, context: ServerInstallContext) @@ -35,18 +36,23 @@ function M.pipe(installers) return function(server, callback, context) local function execute(idx) - local ok, err = pcall(installers[idx], server, function(success) - if not success then - -- oh no, error. exit early - callback(success) - elseif installers[idx + 1] then - -- iterate - execute(idx + 1) - else - -- we done - callback(success) - end - end, context) + local ok, err = pcall( + installers[idx], + server, + vim.schedule_wrap(function(success) + if not success then + -- oh no, error. exit early + callback(success) + elseif installers[idx + 1] then + -- iterate + execute(idx + 1) + else + -- we done + callback(success) + end + end), + context + ) if not ok then context.stdio_sink.stderr(tostring(err) .. "\n") callback(false) |
