summaryrefslogtreecommitdiff
path: root/script/vm/global-manager.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-03-02 20:31:35 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-03-02 20:31:35 +0800
commitbe0d11df2d89b8cb8cf24190ccfbd273256f4c74 (patch)
tree328597311c655f39bc43c9bcb963a4fd7491a65c /script/vm/global-manager.lua
parent4508b4018dced01fe5420e008e813199d0ce856f (diff)
downloadlua-language-server-be0d11df2d89b8cb8cf24190ccfbd273256f4c74.zip
update
Diffstat (limited to 'script/vm/global-manager.lua')
-rw-r--r--script/vm/global-manager.lua11
1 files changed, 8 insertions, 3 deletions
diff --git a/script/vm/global-manager.lua b/script/vm/global-manager.lua
index 5267aea1..4c2a535e 100644
--- a/script/vm/global-manager.lua
+++ b/script/vm/global-manager.lua
@@ -60,15 +60,19 @@ local compilerGlobalMap = util.switch()
---@param source parser.object
: call(function (source)
local name
+ local keyName = guide.getKeyName(source)
+ if not keyName then
+ return
+ end
if source.node._globalNode then
local parentName = source.node._globalNode:getName()
if parentName == '_G' then
- name = guide.getKeyName(source)
+ name = keyName
else
- name = parentName .. m.ID_SPLITE .. guide.getKeyName(source)
+ name = parentName .. m.ID_SPLITE .. keyName
end
elseif source.node.special == '_G' then
- name = guide.getKeyName(source)
+ name = keyName
end
if not name then
return
@@ -117,6 +121,7 @@ local compilerGlobalMap = util.switch()
local global = m.declareGlobal(name, uri)
if source.node.special == 'rawset' then
global:addSet(uri, source)
+ source.value = source.args[3]
else
global:addGet(uri, source)
end