aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/core/async/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/nvim-lsp-installer/core/async/init.lua')
-rw-r--r--lua/nvim-lsp-installer/core/async/init.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/lua/nvim-lsp-installer/core/async/init.lua b/lua/nvim-lsp-installer/core/async/init.lua
index 0c278373..d448bc30 100644
--- a/lua/nvim-lsp-installer/core/async/init.lua
+++ b/lua/nvim-lsp-installer/core/async/init.lua
@@ -72,7 +72,11 @@ local function new_execution_context(suspend_fn, callback, ...)
end
local ok, promise_or_result = co.resume(thread, ...)
if ok then
- if getmetatable(promise_or_result) == Promise then
+ if co.status(thread) == "suspended" then
+ assert(
+ getmetatable(promise_or_result) == Promise,
+ "Expected Promise to have been yielded in async coroutine."
+ )
promise_or_result(step)
else
callback(true, promise_or_result)