diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-06-07 20:19:13 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-06-07 20:19:13 +0800 |
commit | 3750bc297b35615510e9f3f0c3a850baf78a44dc (patch) | |
tree | 7bc9b2138b5652feeb9f406a36563f4408fee638 /script/core/noder.lua | |
parent | 664b740fa40b22180f5055a543c465cb504290cd (diff) | |
download | lua-language-server-3750bc297b35615510e9f3f0c3a850baf78a44dc.zip |
update
Diffstat (limited to 'script/core/noder.lua')
-rw-r--r-- | script/core/noder.lua | 7 |
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 |