summaryrefslogtreecommitdiff
path: root/script-beta/vm/getGlobals.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-12-24 14:42:16 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-12-24 14:42:16 +0800
commitf60fffa9afd4c799c449065cbc5beba68e2bdcb1 (patch)
tree90218eee67448fed9834983b8cb1a094c40e46cc /script-beta/vm/getGlobals.lua
parente3874a12dd5a3273f0d2266134c8764182fc42e3 (diff)
downloadlua-language-server-f60fffa9afd4c799c449065cbc5beba68e2bdcb1.zip
分离 eachRef 与 eachDef
Diffstat (limited to 'script-beta/vm/getGlobals.lua')
-rw-r--r--script-beta/vm/getGlobals.lua9
1 files changed, 3 insertions, 6 deletions
diff --git a/script-beta/vm/getGlobals.lua b/script-beta/vm/getGlobals.lua
index 116bf8d5..b64d63ff 100644
--- a/script-beta/vm/getGlobals.lua
+++ b/script-beta/vm/getGlobals.lua
@@ -8,24 +8,21 @@ local function getGlobals(root)
end
local cache = {}
local mark = {}
- vm.eachField(env, function (info)
- local src = info.source
+ vm.eachField(env, function (src)
if mark[src] then
return
end
mark[src] = true
- local name = info.key
+ local name = guide.getKeyName(src)
if not name then
return
end
if not cache[name] then
cache[name] = {
key = name,
- mode = {},
}
end
- cache[name][#cache[name]+1] = info
- cache[name].mode[info.mode] = true
+ cache[name][#cache[name]+1] = src
vm.cache.getGlobal[src] = name
end)
return cache