summaryrefslogtreecommitdiff
path: root/script/parser
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-06-17 16:45:53 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-06-17 16:45:53 +0800
commite67dd05a15a76d9ee6addb6519fd98e6527d2b09 (patch)
tree520a569d1a4bb8a3e4e0bbbc219e62bc5ed5a969 /script/parser
parent844bc87bcb11fade43e06b5e8ac8421f2b0d3630 (diff)
downloadlua-language-server-e67dd05a15a76d9ee6addb6519fd98e6527d2b09.zip
stash
Diffstat (limited to 'script/parser')
-rw-r--r--script/parser/guide.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/script/parser/guide.lua b/script/parser/guide.lua
index 8d2708cf..ad07e90e 100644
--- a/script/parser/guide.lua
+++ b/script/parser/guide.lua
@@ -972,9 +972,13 @@ end
---@param source parser.guide.object
---@return boolean
function m.isGlobal(source)
+ if source._isGlobal ~= nil then
+ return source._isGlobal
+ end
if source.type == 'setglobal'
or source.type == 'getglobal' then
if source.node and source.node.tag == '_ENV' then
+ source._isGlobal = true
return true
end
end
@@ -982,8 +986,10 @@ function m.isGlobal(source)
source = source.parent
end
if source.special == '_G' then
+ source._isGlobal = true
return true
end
+ source._isGlobal = false
return false
end