aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-core/async/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/mason-core/async/init.lua')
-rw-r--r--lua/mason-core/async/init.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/lua/mason-core/async/init.lua b/lua/mason-core/async/init.lua
index 03963264..e3a2e850 100644
--- a/lua/mason-core/async/init.lua
+++ b/lua/mason-core/async/init.lua
@@ -78,7 +78,8 @@ local function new_execution_context(suspend_fn, callback, ...)
if cancelled or not thread then
return
end
- local ok, promise_or_result = co.resume(thread, ...)
+ local results = { co.resume(thread, ...) }
+ local ok, promise_or_result = results[1], results[2]
if cancelled or not thread then
return
end
@@ -88,7 +89,7 @@ local function new_execution_context(suspend_fn, callback, ...)
promise_or_result(step)
else
-- yield to parent coroutine
- step(coroutine.yield(promise_or_result))
+ step(coroutine.yield(promise_or_result, unpack(results, 3)))
end
else
callback(true, promise_or_result)