summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script-beta/core/completion.lua4
-rw-r--r--script-beta/vm/getGlobals.lua10
2 files changed, 7 insertions, 7 deletions
diff --git a/script-beta/core/completion.lua b/script-beta/core/completion.lua
index 8ff374b7..1a7267ce 100644
--- a/script-beta/core/completion.lua
+++ b/script-beta/core/completion.lua
@@ -442,14 +442,14 @@ local function checkFieldOfRefs(refs, ast, word, start, offset, parent, oop, res
if not key or key:sub(1, 1) ~= 's' then
goto CONTINUE
end
- local name = key:sub(3)
if isSameSource(ast, src, start) then
-- 由于fastGlobal的优化,全局变量只会找出一个值,有可能找出自己
-- 所以遇到自己的时候重新找一下有没有其他定义
- if #vm.getGlobals(name) <= 1 then
+ if #vm.getGlobals(key) <= 1 then
goto CONTINUE
end
end
+ local name = key:sub(3)
if locals and locals[name] then
goto CONTINUE
end
diff --git a/script-beta/vm/getGlobals.lua b/script-beta/vm/getGlobals.lua
index 4c0abe3d..9d51ec31 100644
--- a/script-beta/vm/getGlobals.lua
+++ b/script-beta/vm/getGlobals.lua
@@ -83,16 +83,16 @@ local function getAnyGlobalsFast()
return results
end
-function vm.getGlobals(name)
- if name == '*' and config.config.intelliSense.fastGlobal then
+function vm.getGlobals(key)
+ if key == '*' and config.config.intelliSense.fastGlobal then
return getAnyGlobalsFast()
end
- local cache = vm.getCache('getGlobals')[name]
+ local cache = vm.getCache('getGlobals')[key]
if cache ~= nil then
return cache
end
- cache = getGlobals(name)
- vm.getCache('getGlobals')[name] = cache
+ cache = getGlobals(key)
+ vm.getCache('getGlobals')[key] = cache
return cache
end