summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-06-18 18:01:00 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-06-18 18:01:00 +0800
commit881fab2e2bb5b935da5354d501972881a7777605 (patch)
treee86a021dd8462e44bc019d4d705ccea99ff3ad57 /script/core
parentbc4648dca8384b68a128ab5096ec2e36aa0546fe (diff)
downloadlua-language-server-881fab2e2bb5b935da5354d501972881a7777605.zip
allow more steps
Diffstat (limited to 'script/core')
-rw-r--r--script/core/searcher.lua19
1 files changed, 15 insertions, 4 deletions
diff --git a/script/core/searcher.lua b/script/core/searcher.lua
index 05733af4..79e80577 100644
--- a/script/core/searcher.lua
+++ b/script/core/searcher.lua
@@ -373,7 +373,7 @@ function m.searchRefsByID(status, uri, expect, mode)
local btag = {}
local function checkThenPushTag(ward, tag)
- if not tag then
+ if not tag or tag == 'deep' then
return true
end
local checkTags
@@ -393,7 +393,7 @@ function m.searchRefsByID(status, uri, expect, mode)
end
local function popTag(ward, tag)
- if not tag then
+ if not tag or tag == 'deep' then
return
end
local popTags
@@ -602,11 +602,22 @@ function m.searchRefsByID(status, uri, expect, mode)
end
local stepCount = 0
+ local stepMaxCount = 1e3
+ local statusMaxCount = 1e4
+ if mode == 'allref' then
+ stepMaxCount = 1e4
+ statusMaxCount = 1e5
+ end
function searchStep(id, field)
stepCount = stepCount + 1
status.count = status.count + 1
- if stepCount > 1000
- or status.count > 10000 then
+ if mode == 'allref' then
+ if status.count % 1e4 == 0 then
+ await.delay()
+ end
+ end
+ if stepCount > stepMaxCount
+ or status.count > statusMaxCount then
if TEST then
if FOOTPRINT then
log.debug(table.concat(status.footprint, '\n'))