diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-07-22 17:33:43 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-07-22 17:33:43 +0800 |
commit | 51fd9b20bb56541eaf7c8e70beb9eb65192e7687 (patch) | |
tree | 1a5e3e4b086be6437a69e8a2055a9af019a030be /script-beta/vm/eachDef.lua | |
parent | c652ff3836785b7c8d6da83d3544a9fef09da752 (diff) | |
download | lua-language-server-51fd9b20bb56541eaf7c8e70beb9eb65192e7687.zip |
暂存
Diffstat (limited to 'script-beta/vm/eachDef.lua')
-rw-r--r-- | script-beta/vm/eachDef.lua | 11 |
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 |