diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-09-18 19:27:44 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-09-18 19:27:44 +0800 |
commit | 1d512d14481843c20a0760af6f2f19c6ad497861 (patch) | |
tree | 50bb8be23d3866abfde89c50e1332a03a2ec1d25 /script-beta/vm | |
parent | ebe404b5f861f251722144f260f364cd0b3b2981 (diff) | |
download | lua-language-server-1d512d14481843c20a0760af6f2f19c6ad497861.zip |
只有第一层的cache为全局共享
Diffstat (limited to 'script-beta/vm')
-rw-r--r-- | script-beta/vm/guideInterface.lua | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/script-beta/vm/guideInterface.lua b/script-beta/vm/guideInterface.lua index c85194d8..a77184f3 100644 --- a/script-beta/vm/guideInterface.lua +++ b/script-beta/vm/guideInterface.lua @@ -111,23 +111,9 @@ function vm.interface.index(obj) return nil end -function vm.interface.cache(source, mode) +function vm.interface.cache() await.delay() - local cache = vm.getCache('cache') - if not cache[mode] then - cache[mode] = {} - end - local sourceCache = cache[mode][source] - if sourceCache then - return sourceCache - end - sourceCache = {} - cache[mode][source] = sourceCache - return nil, function (results) - for i = 1, #results do - sourceCache[i] = results[i] - end - end + return vm.getCache('cache') end function vm.setSearchLevel(n) |