diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-09-21 20:52:05 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-09-21 20:52:05 +0800 |
commit | ca322946af06afa7bfd93fa176812ceed854730e (patch) | |
tree | e32e54acea059359a27ecf35c9ab305d8a5e0f51 /script-beta/vm/getInfer.lua | |
parent | 0bb3565ed9e8f3fb0d9501f7ac2b3c7aa0245a86 (diff) | |
download | lua-language-server-ca322946af06afa7bfd93fa176812ceed854730e.zip |
优化性能
Diffstat (limited to 'script-beta/vm/getInfer.lua')
-rw-r--r-- | script-beta/vm/getInfer.lua | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/script-beta/vm/getInfer.lua b/script-beta/vm/getInfer.lua index 9e48e432..18f7f0ef 100644 --- a/script-beta/vm/getInfer.lua +++ b/script-beta/vm/getInfer.lua @@ -29,13 +29,13 @@ function vm.hasInferType(source, type) return false end -function vm.getInferType(source) - local infers = vm.getInfers(source) +function vm.getInferType(source, simple) + local infers = vm.getInfers(source, simple) return guide.viewInferType(infers) end -function vm.getInferLiteral(source) - local infers = vm.getInfers(source) +function vm.getInferLiteral(source, simple) + local infers = vm.getInfers(source, simple) local literals = {} local mark = {} for _, infer in ipairs(infers) do @@ -54,12 +54,12 @@ end --- 获取对象的值 --- 会尝试穿透函数调用 -function vm.getInfers(source) +function vm.getInfers(source, simple) if not source then return end local clock = os.clock() - local infers = guide.requestInfer(source, vm.interface) + local infers = guide.requestInfer(source, vm.interface, simple) if os.clock() - clock > 0.1 then log.warn(('Request infer takes [%.3f]sec! %s %s'):format(os.clock() - clock, guide.getUri(source), util.dump(source, { deep = 1 }))) end |