summaryrefslogtreecommitdiff
path: root/script-beta/vm/eachDef.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-07-22 17:33:43 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-07-22 17:33:43 +0800
commit51fd9b20bb56541eaf7c8e70beb9eb65192e7687 (patch)
tree1a5e3e4b086be6437a69e8a2055a9af019a030be /script-beta/vm/eachDef.lua
parentc652ff3836785b7c8d6da83d3544a9fef09da752 (diff)
downloadlua-language-server-51fd9b20bb56541eaf7c8e70beb9eb65192e7687.zip
暂存
Diffstat (limited to 'script-beta/vm/eachDef.lua')
-rw-r--r--script-beta/vm/eachDef.lua11
1 files changed, 8 insertions, 3 deletions
diff --git a/script-beta/vm/eachDef.lua b/script-beta/vm/eachDef.lua
index 92982660..65878ebf 100644
--- a/script-beta/vm/eachDef.lua
+++ b/script-beta/vm/eachDef.lua
@@ -79,10 +79,15 @@ function m.eachDef(source, results)
return results
end
-function vm.eachDef(source, callback)
+function vm.getDefs(source)
local cache = vm.cache.eachDef[source] or m.eachDef(source)
vm.cache.eachDef[source] = cache
- for i = 1, #cache do
- callback(cache[i])
+ return cache
+end
+
+function vm.eachDef(source, callback)
+ local results = vm.getDefs(source)
+ for i = 1, #results do
+ callback(results[i])
end
end