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/getLibrary.lua | |
parent | 729073ec3619cde7c6be8102bc6e390f83d0dffd (diff) | |
download | lua-language-server-a0b38e22f3c20c2cff737d489c12eee740c9f6f5.zip |
优化一下大文件诊断的响应
Diffstat (limited to 'script-beta/vm/getLibrary.lua')
-rw-r--r-- | script-beta/vm/getLibrary.lua | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/script-beta/vm/getLibrary.lua b/script-beta/vm/getLibrary.lua index d2f88116..69280fd9 100644 --- a/script-beta/vm/getLibrary.lua +++ b/script-beta/vm/getLibrary.lua @@ -71,13 +71,12 @@ local function checkNode(source) end local function getLibrary(source) - local lib = checkStdLibrary(source) - if lib then - return lib - end - return checkNode(source) or vm.eachRef(source, function (info) - return checkStdLibrary(info.source) or checkNode(info.source) - end) + return checkNode(source) + or checkStdLibrary(source) + or vm.eachRef(source, function (info) + return checkStdLibrary(info.source) + or checkNode(info.source) + end, 100) end function vm.getLibrary(source) |