summaryrefslogtreecommitdiff
path: root/script-beta
diff options
context:
space:
mode:
Diffstat (limited to 'script-beta')
-rw-r--r--script-beta/core/completion.lua2
-rw-r--r--script-beta/vm/getGlobals.lua17
2 files changed, 12 insertions, 7 deletions
diff --git a/script-beta/core/completion.lua b/script-beta/core/completion.lua
index 42164171..11bc4117 100644
--- a/script-beta/core/completion.lua
+++ b/script-beta/core/completion.lua
@@ -431,7 +431,7 @@ local function checkFieldOfRefs(refs, ast, word, start, offset, parent, oop, res
end
if #vm.getGlobals(key) <= 1 then
goto CONTINUE
- else
+ elseif not guide.isSet(src) then
src = vm.getGlobalSets(key)[1] or src
end
end
diff --git a/script-beta/vm/getGlobals.lua b/script-beta/vm/getGlobals.lua
index ccc86f7b..4fe95ee9 100644
--- a/script-beta/vm/getGlobals.lua
+++ b/script-beta/vm/getGlobals.lua
@@ -128,9 +128,15 @@ local function fastGetAnyGlobals()
local results = {}
local mark = {}
for uri in files.eachFile() do
- local cache = files.getCache(uri)
- cache.globals = cache.globals or getGlobalsOfFile(uri)
- for destName, sources in util.sortPairs(cache.globals) do
+ --local globalSets = getGlobalsOfFile(uri)
+ --for destName, sources in util.sortPairs(globalSets) do
+ -- if not mark[destName] then
+ -- mark[destName] = true
+ -- results[#results+1] = sources[1]
+ -- end
+ --end
+ local globals = getGlobalsOfFile(uri)
+ for destName, sources in util.sortPairs(globals) do
if not mark[destName] then
mark[destName] = true
results[#results+1] = sources[1]
@@ -145,9 +151,8 @@ local function fastGetAnyGlobalSets()
local results = {}
local mark = {}
for uri in files.eachFile() do
- local cache = files.getCache(uri)
- cache.globalSets = cache.globalSets or getGlobalSetsOfFile(uri)
- for destName, sources in util.sortPairs(cache.globalSets) do
+ local globals = getGlobalSetsOfFile(uri)
+ for destName, sources in util.sortPairs(globals) do
if not mark[destName] then
mark[destName] = true
results[#results+1] = sources[1]