diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-05-29 16:45:03 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-05-29 16:45:03 +0800 |
commit | bf15a6d9e9e3ea5e86596cd84ff4e3b4f12e29f9 (patch) | |
tree | db51d275388a273466190fca6d9e19771507286e /script-beta/vm/getGlobals.lua | |
parent | 59afbeaed024d2610d4f514d9c1255e3394008c9 (diff) | |
download | lua-language-server-bf15a6d9e9e3ea5e86596cd84ff4e3b4f12e29f9.zip |
更新中
Diffstat (limited to 'script-beta/vm/getGlobals.lua')
-rw-r--r-- | script-beta/vm/getGlobals.lua | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/script-beta/vm/getGlobals.lua b/script-beta/vm/getGlobals.lua index 2760fea4..0ff92e3a 100644 --- a/script-beta/vm/getGlobals.lua +++ b/script-beta/vm/getGlobals.lua @@ -7,12 +7,8 @@ local function getGlobals(root) return nil end local cache = {} - local mark = {} - vm.eachField(env, function (src) - if mark[src] then - return - end - mark[src] = true + local fields = guide.requestFields(env) + for _, src in ipairs(fields) do local name = vm.getKeyName(src) if not name then return @@ -24,7 +20,7 @@ local function getGlobals(root) end cache[name][#cache[name]+1] = src vm.cache.getGlobal[src] = name - end) + end return cache end |