summaryrefslogtreecommitdiff
path: root/script/vm/compiler.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-01 17:54:19 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-01 17:54:19 +0800
commitd699b4cac83b81b023323076b74d3d03b6b13ee6 (patch)
treef5b22d0425e0e467a1604d43b4ed6b22b697c81e /script/vm/compiler.lua
parent231e4e3b2be6f815c1d6734185537f777ef32d88 (diff)
downloadlua-language-server-d699b4cac83b81b023323076b74d3d03b6b13ee6.zip
update
Diffstat (limited to 'script/vm/compiler.lua')
-rw-r--r--script/vm/compiler.lua13
1 files changed, 10 insertions, 3 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua
index 158fdc36..6f542367 100644
--- a/script/vm/compiler.lua
+++ b/script/vm/compiler.lua
@@ -32,9 +32,16 @@ local searchFieldSwitch = util.switch()
---@param node vm.node.global
: call(function (node, key, pushResult)
if node.cate == 'variable' then
- local global = globalMgr.getGlobal('variable', node.name, key)
- if global then
- pushResult(global)
+ if key then
+ local global = globalMgr.getGlobal('variable', node.name, key)
+ if global then
+ pushResult(global)
+ end
+ else
+ local globals = globalMgr.getFields('variable', node.name)
+ for _, global in ipairs(globals) do
+ pushResult(global)
+ end
end
end
if node.cate == 'type' then