diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-11-05 21:03:59 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-11-05 21:03:59 +0800 |
commit | 88f4308a520298c9399850a23dd5f1ae05164334 (patch) | |
tree | 327167142a3c879cc91b17a7e83509a5d589a092 /script-beta/core/hover/table.lua | |
parent | 6f927f4fa9a7c6e0446755a3f6aa86570c684754 (diff) | |
download | lua-language-server-88f4308a520298c9399850a23dd5f1ae05164334.zip |
table的hover最多只显示1000个字段
Diffstat (limited to 'script-beta/core/hover/table.lua')
-rw-r--r-- | script-beta/core/hover/table.lua | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/script-beta/core/hover/table.lua b/script-beta/core/hover/table.lua index ff4012bb..e484553b 100644 --- a/script-beta/core/hover/table.lua +++ b/script-beta/core/hover/table.lua @@ -229,6 +229,7 @@ return function (source) local timeUp local mark = {} local fields = vm.getFields(source, 'deep') + local keyCount = 0 for _, src in ipairs(fields) do local key = getKey(src) if not key then @@ -236,6 +237,7 @@ return function (source) end if not classes[key] then classes[key] = {} + keyCount = keyCount + 1 end if not literals[key] then literals[key] = {} @@ -249,6 +251,9 @@ return function (source) end classes[key][#classes[key]+1] = class literals[key][#literals[key]+1] = literal + if keyCount >= 1000 then + break + end ::CONTINUE:: end |