summaryrefslogtreecommitdiff
path: root/script/core/noder.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-06-07 20:19:13 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-06-07 20:19:13 +0800
commit3750bc297b35615510e9f3f0c3a850baf78a44dc (patch)
tree7bc9b2138b5652feeb9f406a36563f4408fee638 /script/core/noder.lua
parent664b740fa40b22180f5055a543c465cb504290cd (diff)
downloadlua-language-server-3750bc297b35615510e9f3f0c3a850baf78a44dc.zip
update
Diffstat (limited to 'script/core/noder.lua')
-rw-r--r--script/core/noder.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/script/core/noder.lua b/script/core/noder.lua
index 681f4209..9882ab91 100644
--- a/script/core/noder.lua
+++ b/script/core/noder.lua
@@ -72,7 +72,12 @@ local function getKey(source)
return tostring(source.node.start), nil
elseif source.type == 'setglobal'
or source.type == 'getglobal' then
- return ('%q'):format(source[1] or ''), nil
+ local node = source.node
+ if node.tag == '_ENV' then
+ return ('%q'):format(source[1] or ''), nil
+ else
+ return ('%q'):format(source[1] or ''), node
+ end
elseif source.type == 'getfield'
or source.type == 'setfield' then
return ('%q'):format(source.field and source.field[1] or ''), source.node