diff options
author | AlexCai2019 <89138532+AlexCai2019@users.noreply.github.com> | 2022-05-08 01:43:28 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-08 01:43:28 +0800 |
commit | 0fd83c4ca9f82a02becab6c304a8a7de75098507 (patch) | |
tree | be9790d9d4823fe728c5b36e94093fe5f42b7725 /script/vm/local-manager.lua | |
parent | 89203efad8c9b5513e05ca4d5696107924865b10 (diff) | |
parent | 67b4c574849d1667e0ecb39c51aeed8e30b43056 (diff) | |
download | lua-language-server-0fd83c4ca9f82a02becab6c304a8a7de75098507.zip |
Merge branch 'sumneko:master' into master
Diffstat (limited to 'script/vm/local-manager.lua')
-rw-r--r-- | script/vm/local-manager.lua | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/script/vm/local-manager.lua b/script/vm/local-manager.lua deleted file mode 100644 index 51bafb24..00000000 --- a/script/vm/local-manager.lua +++ /dev/null @@ -1,40 +0,0 @@ -local util = require 'utility' -local guide = require 'parser.guide' - ----@class vm.local-node -local m = {} ----@type table<uri, parser.object[]> -m.locals = util.multiTable(2) ----@type table<parser.object, table<parser.object, boolean>> -m.localSubs = util.multiTable(2, function () - return setmetatable({}, util.MODE_K) -end) ----@type table<parser.object, boolean> -m.allLocals = {} - ----@param source parser.object -function m.declareLocal(source) - if m.allLocals[source] then - return - end - m.allLocals[source] = true - local uri = guide.getUri(source) - local locals = m.locals[uri] - locals[#locals+1] = source -end - ----@param uri uri -function m.dropUri(uri) - local locals = m.locals[uri] - m.locals[uri] = nil - for _, loc in ipairs(locals) do - m.allLocals[loc] = nil - local localSubs = m.localSubs[loc] - m.localSubs[loc] = nil - for source in pairs(localSubs) do - source._node = nil - end - end -end - -return m |