summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-06-21 17:27:21 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-06-21 17:27:21 +0800
commit693226b24fb0888c12e89e6b413bf21522eed423 (patch)
tree76e273299c5065bfc3fc958894721bcd0712d3f2 /script/core
parent600f5e09cd79585aba80ee692ca0a0995b874451 (diff)
downloadlua-language-server-693226b24fb0888c12e89e6b413bf21522eed423.zip
limit cross file
Diffstat (limited to 'script/core')
-rw-r--r--script/core/searcher.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/script/core/searcher.lua b/script/core/searcher.lua
index 79b605b5..f29b6a29 100644
--- a/script/core/searcher.lua
+++ b/script/core/searcher.lua
@@ -181,10 +181,10 @@ function m.getObjectValue(obj)
end
local function crossSearch(status, uri, expect, mode, sourceUri)
- if status.lock[uri] then
+ if status.lock[uri] and status.lock[uri] >= 3 then
return
end
- status.lock[uri] = true
+ status.lock[uri] = (status.lock[uri] or 0) + 1
--await.delay()
if TRACE then
log.debug('crossSearch', uri, expect)
@@ -193,7 +193,10 @@ local function crossSearch(status, uri, expect, mode, sourceUri)
status.footprint[#status.footprint+1] = ('cross search:%s %s'):format(uri, expect)
end
m.searchRefsByID(status, uri, expect, mode)
- status.lock[uri] = nil
+ status.lock[uri] = status.lock[uri] - 1
+ if TRACE then
+ log.debug('crossSearch finish, back to:', uri)
+ end
if FOOTPRINT then
status.footprint[#status.footprint+1] = ('cross search finish, back to: %s'):format(sourceUri)
end