summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-06-17 17:22:42 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-06-17 17:22:42 +0800
commit2862d7cd292927b608523f5b8ede49c227e7065c (patch)
tree53eb0a3e46f34231f7937a7ff33c10cf14a55e3d /script/core
parente67dd05a15a76d9ee6addb6519fd98e6527d2b09 (diff)
parent6a26535292674b2cfb683b8b66425b5a79caf4e1 (diff)
downloadlua-language-server-2862d7cd292927b608523f5b8ede49c227e7065c.zip
Merge commit '6a26535292674b2cfb683b8b66425b5a79caf4e1' into 2.0.0
Diffstat (limited to 'script/core')
-rw-r--r--script/core/guide2.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/script/core/guide2.lua b/script/core/guide2.lua
index 576c0c20..183555b3 100644
--- a/script/core/guide2.lua
+++ b/script/core/guide2.lua
@@ -3021,7 +3021,7 @@ function m.searchSameFields(status, simple, mode)
locks[start] = lock
end
if lock[obj] then
- return
+ return false
end
lock[obj] = true
queueLen = queueLen + 1
@@ -3037,13 +3037,17 @@ function m.searchSameFields(status, simple, mode)
forces[queueLen] = force
end
end
+ return true
end
local function pushQueue(obj, start, force)
if obj.type == 'getlocal'
or obj.type == 'setlocal' then
obj = obj.node
end
- appendQueue(obj, start, force)
+ if appendQueue(obj, start, force) == false then
+ -- no need to process the rest if obj is already locked
+ return
+ end
if obj.type == 'local' and obj.ref then
for _, ref in ipairs(obj.ref) do
appendQueue(ref, start, force)