diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-11-20 21:57:09 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-11-20 21:57:09 +0800 |
commit | 4ca61ec457822dd14966afa0752340ae8ce180a1 (patch) | |
tree | ae8adb1ad82c717868e551e699fd3cf3bb290089 /script-beta/vm/eachDef.lua | |
parent | c63b2e404d8d2bb984afe3678a5ba2b2836380cc (diff) | |
download | lua-language-server-4ca61ec457822dd14966afa0752340ae8ce180a1.zip |
no longer beta
Diffstat (limited to 'script-beta/vm/eachDef.lua')
-rw-r--r-- | script-beta/vm/eachDef.lua | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/script-beta/vm/eachDef.lua b/script-beta/vm/eachDef.lua deleted file mode 100644 index 5ff58889..00000000 --- a/script-beta/vm/eachDef.lua +++ /dev/null @@ -1,40 +0,0 @@ -local vm = require 'vm.vm' -local guide = require 'parser.guide' -local files = require 'files' -local util = require 'utility' -local await = require 'await' - -local function eachDef(source, deep) - local results = {} - local lock = vm.lock('eachDef', source) - if not lock then - return results - end - - await.delay() - - local clock = os.clock() - local myResults, count = guide.requestDefinition(source, vm.interface, deep) - if DEVELOP and os.clock() - clock > 0.1 then - log.warn('requestDefinition', count, os.clock() - clock, guide.getUri(source), util.dump(source, { deep = 1 })) - end - vm.mergeResults(results, myResults) - - lock() - - return results -end - -function vm.getDefs(source, deep) - if guide.isGlobal(source) then - local key = guide.getKeyName(source) - return vm.getGlobalSets(key) - else - local cache = vm.getCache('eachDef')[source] - or eachDef(source, deep) - if deep then - vm.getCache('eachDef')[source] = cache - end - return cache - end -end |