diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-04-25 18:01:26 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-04-25 18:01:26 +0800 |
commit | 7c66961eb580f5932d61c1419cdf3b14960496a8 (patch) | |
tree | a6933d92cbbcc05f8ec13c3b6619a56016176703 /script/core | |
parent | e03be9947cc8cfaeebf35b663477cd84fde7c45c (diff) | |
download | lua-language-server-7c66961eb580f5932d61c1419cdf3b14960496a8.zip |
reject fields too longer
Diffstat (limited to 'script/core')
-rw-r--r-- | script/core/searcher.lua | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/script/core/searcher.lua b/script/core/searcher.lua index ede0178c..46d58940 100644 --- a/script/core/searcher.lua +++ b/script/core/searcher.lua @@ -175,10 +175,20 @@ function m.searchRefsByID(status, uri, expect, mode) local index = 0 local function search(id, field) - if mark[id] then + local fullID + if field then + fullID = id .. '\x1E' .. field + local _, len = field:gsub(linker.SPLIT_CHAR, '') + if len >= 10 then + return + end + else + fullID = id + end + if mark[fullID] then return end - mark[id] = true + mark[fullID] = true index = index + 1 queueIDs[index] = id queueFields[index] = field |