summaryrefslogtreecommitdiff
path: root/script-beta
diff options
context:
space:
mode:
Diffstat (limited to 'script-beta')
-rw-r--r--script-beta/core/diagnostics/redundant-parameter.lua8
-rw-r--r--script-beta/parser/guide.lua28
2 files changed, 21 insertions, 15 deletions
diff --git a/script-beta/core/diagnostics/redundant-parameter.lua b/script-beta/core/diagnostics/redundant-parameter.lua
index acb6f63c..ef0f172a 100644
--- a/script-beta/core/diagnostics/redundant-parameter.lua
+++ b/script-beta/core/diagnostics/redundant-parameter.lua
@@ -62,14 +62,10 @@ return function (uri, callback)
local func = source.node
local funcArgs
- if not vm.hasType(func, 'function') then
- return
- end
local defs = vm.getDefs(func)
for _, def in ipairs(defs) do
- local value = guide.getObjectValue(def) or def
- if value.type == 'function' then
- local args = countFuncArgs(value)
+ if def.type == 'function' then
+ local args = countFuncArgs(def)
if not funcArgs or args > funcArgs then
funcArgs = args
end
diff --git a/script-beta/parser/guide.lua b/script-beta/parser/guide.lua
index 13388a34..23cdb444 100644
--- a/script-beta/parser/guide.lua
+++ b/script-beta/parser/guide.lua
@@ -1890,15 +1890,26 @@ function m.cleanResults(results)
end
--function m.getRefCache(status, obj, mode)
--- if not status.interface.cache then
+-- local cache = status.interface.cache and status.interface.cache()
+-- if not cache then
-- return
-- end
--- if obj.type == 'getglobal'
--- or obj.type == 'setglobal' then
--- local name = m.getKeyName(obj)
--- return status.interface.cache(name, mode, status.index == 1)
--- else
--- return status.interface.cache(obj, mode, status.index == 1)
+-- if m.isGlobal(obj) then
+-- obj = m.getKeyName(obj)
+-- end
+-- if not cache[mode] then
+-- cache[mode] = {}
+-- end
+-- local sourceCache = cache[mode][obj]
+-- if sourceCache then
+-- return sourceCache
+-- end
+-- sourceCache = {}
+-- cache[mode][obj] = sourceCache
+-- return nil, function (results)
+-- for i = 1, #results do
+-- sourceCache[i] = results[i]
+-- end
-- end
--end
@@ -1909,8 +1920,7 @@ function m.getRefCache(status, obj, mode)
end
cache = status.cache.refCache or {}
status.cache.refCache = cache
- if obj.type == 'getglobal'
- or obj.type == 'setglobal' then
+ if m.isGlobal(obj) then
obj = m.getKeyName(obj)
end
if not cache[mode] then