diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-12-09 16:21:05 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-12-09 16:21:05 +0800 |
commit | a0b38e22f3c20c2cff737d489c12eee740c9f6f5 (patch) | |
tree | c0fc93539ffc660b298f0245791ab79209b20996 /script-beta/vm/getValue.lua | |
parent | 729073ec3619cde7c6be8102bc6e390f83d0dffd (diff) | |
download | lua-language-server-a0b38e22f3c20c2cff737d489c12eee740c9f6f5.zip |
优化一下大文件诊断的响应
Diffstat (limited to 'script-beta/vm/getValue.lua')
-rw-r--r-- | script-beta/vm/getValue.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/script-beta/vm/getValue.lua b/script-beta/vm/getValue.lua index bde3fad2..a93ed6e9 100644 --- a/script-beta/vm/getValue.lua +++ b/script-beta/vm/getValue.lua @@ -682,7 +682,7 @@ end local function inferBySetOfLocal(results, source) if source.ref then - for i = 1, #source.ref do + for i = 1, math.min(#source.ref, 100) do local ref = source.ref[i] if ref.type == 'setlocal' then break @@ -700,7 +700,7 @@ local function inferBySet(results, source) inferBySetOfLocal(results, source) elseif source.type == 'setlocal' or source.type == 'getlocal' then - inferBySetOfLocal(results, source.node) + merge(results, vm.getValue(source.node)) end end |