summaryrefslogtreecommitdiff
path: root/script/vm
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-08 03:17:19 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-08 03:17:19 +0800
commit5362015b546b94c124e8add5e11ba261105f439a (patch)
tree650ec9709bc02f43e0c26bfbd4d6dc9b5fd90d61 /script/vm
parent8046578f19aecfdc3af4ce8408d5517ad314c915 (diff)
downloadlua-language-server-5362015b546b94c124e8add5e11ba261105f439a.zip
update
Diffstat (limited to 'script/vm')
-rw-r--r--script/vm/ref.lua12
1 files changed, 10 insertions, 2 deletions
diff --git a/script/vm/ref.lua b/script/vm/ref.lua
index 7849fda9..052d74eb 100644
--- a/script/vm/ref.lua
+++ b/script/vm/ref.lua
@@ -85,15 +85,23 @@ simpleSwitch = util.switch()
local function searchInAllFiles(suri, searcher, notify)
searcher(suri)
+ local uris = {}
for uri in files.eachFile(suri) do
if not vm.isMetaFile(uri)
and suri ~= uri then
+ uris[#uris+1] = uri
+ end
+ end
+
+ for _, uri in ipairs(uris) do
+ if notify then
local continue = notify(uri)
if continue == false then
break
end
- searcher(uri)
end
+ await.delay()
+ searcher(uri)
end
end
@@ -286,7 +294,7 @@ function vm.getRefs(source, fileNotify)
searchBySimple(source, pushResult)
searchByLocalID(source, pushResult)
searchByNode(source, pushResult)
- searchByParentNode(source, pushResult, fileNotify or await.delay)
+ searchByParentNode(source, pushResult, fileNotify)
return results
end