diff options
| author | William Boman <william@redwill.se> | 2022-04-16 01:43:09 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-16 01:43:09 +0200 |
| commit | c472f3ea46a5dd5f62bb12b5857e779ae0d74dc5 (patch) | |
| tree | 0956a0e6f3b931921563eae6265abd3bad481d9b /lua/nvim-lsp-installer/core/installer/init.lua | |
| parent | run autogen_metadata.lua (diff) | |
| download | mason-c472f3ea46a5dd5f62bb12b5857e779ae0d74dc5.tar mason-c472f3ea46a5dd5f62bb12b5857e779ae0d74dc5.tar.gz mason-c472f3ea46a5dd5f62bb12b5857e779ae0d74dc5.tar.bz2 mason-c472f3ea46a5dd5f62bb12b5857e779ae0d74dc5.tar.lz mason-c472f3ea46a5dd5f62bb12b5857e779ae0d74dc5.tar.xz mason-c472f3ea46a5dd5f62bb12b5857e779ae0d74dc5.tar.zst mason-c472f3ea46a5dd5f62bb12b5857e779ae0d74dc5.zip | |
fix(async): slightly better support for nested coroutine contexts (#600)
* fix(async): only dispatch first failure in a.wait_all
* add InstallContext:run_concurrently
This is needed due to how multiple coroutine contexts are used in a hierchical
structure, and the async coroutine dispatcher loses this hierchical context
inside callback functions invoked via FFI (I… assume?).
Diffstat (limited to 'lua/nvim-lsp-installer/core/installer/init.lua')
| -rw-r--r-- | lua/nvim-lsp-installer/core/installer/init.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lua/nvim-lsp-installer/core/installer/init.lua b/lua/nvim-lsp-installer/core/installer/init.lua index dc9143a2..888415f2 100644 --- a/lua/nvim-lsp-installer/core/installer/init.lua +++ b/lua/nvim-lsp-installer/core/installer/init.lua @@ -34,6 +34,7 @@ end function M.run_installer(context, installer) local thread = coroutine.create(installer) local step + local ret_val step = function(...) local ok, result = coroutine.resume(thread, ...) if not ok then @@ -43,9 +44,12 @@ function M.run_installer(context, installer) elseif coroutine.status(thread) == "suspended" then -- yield to parent coroutine step(coroutine.yield(result)) + else + ret_val = result end end step(context) + return ret_val end ---@async |
