summaryrefslogtreecommitdiff
path: root/script/await.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-07-19 16:14:06 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-07-19 16:14:06 +0800
commit83aa702b33d5dd66e35ddb6883cd8d7417b5f83b (patch)
tree6c50f1b147e3de3ddea5de7b79074c3f5eaf4ff2 /script/await.lua
parent0108cc7c485a2885976d33e2da9419b97223e66e (diff)
downloadlua-language-server-83aa702b33d5dd66e35ddb6883cd8d7417b5f83b.zip
speed up tests
Diffstat (limited to 'script/await.lua')
-rw-r--r--script/await.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/script/await.lua b/script/await.lua
index fa2aea13..22745570 100644
--- a/script/await.lua
+++ b/script/await.lua
@@ -108,6 +108,11 @@ function m.hasID(id, co)
return m.idMap[id] and m.idMap[id][co] ~= nil
end
+function m.unique(id, callback)
+ m.close(id)
+ m.setID(id, callback)
+end
+
--- 休眠一段时间
---@param time number
---@async