diff options
author | Arcanox <arcanox@arcanox.me> | 2021-09-25 18:00:15 -0500 |
---|---|---|
committer | Arcanox <arcanox@arcanox.me> | 2021-09-25 18:00:15 -0500 |
commit | dc685d1addad2f2e57f55a20bb6cca79c222c130 (patch) | |
tree | abb200fd7f217460a4543cb6f32af7ebac308bc0 /script/await.lua | |
parent | a465b35d5eefc11c1daf3c29b41ce95ee098a782 (diff) | |
parent | 1f0a2d0e9283a4cb7f7b3fc72258eb1c5ba4e5dd (diff) | |
download | lua-language-server-dc685d1addad2f2e57f55a20bb6cca79c222c130.zip |
Merge branch 'master' into improve-semantic-highlighting
# Conflicts:
# script/core/semantic-tokens.lua
Diffstat (limited to 'script/await.lua')
-rw-r--r-- | script/await.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/script/await.lua b/script/await.lua index 2d27ae2c..495f381c 100644 --- a/script/await.lua +++ b/script/await.lua @@ -1,11 +1,12 @@ local timer = require 'timer' -local util = require 'utility' + +local wkmt = { __mode = 'k' } ---@class await local m = {} m.type = 'await' -m.coMap = setmetatable({}, { __mode = 'k' }) +m.coMap = setmetatable({}, wkmt) m.idMap = {} m.delayQueue = {} m.delayQueueIndex = 1 @@ -74,7 +75,7 @@ function m.setID(id, co) return end if not m.idMap[id] then - m.idMap[id] = setmetatable({}, { __mode = 'k' }) + m.idMap[id] = setmetatable({}, wkmt) end m.idMap[id][co] = true end @@ -85,6 +86,7 @@ function m.close(id) if not map then return end + m.idMap[id] = nil for co in pairs(map) do if coroutine.status(co) == 'suspended' then map[co] = nil |