summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-06-11 15:29:11 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-06-11 15:29:11 +0800
commitd93c5645334b392284a7a171e66d1b82a997a841 (patch)
tree3f6e184c6b947b785af6da29338bb3273be45052 /script/core
parente6f1dd06dbe5c70a8f8b239b73bb3e4a8caf7554 (diff)
downloadlua-language-server-d93c5645334b392284a7a171e66d1b82a997a841.zip
docs cache
Diffstat (limited to 'script/core')
-rw-r--r--script/core/searcher.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/script/core/searcher.lua b/script/core/searcher.lua
index 095ff782..f1dd9508 100644
--- a/script/core/searcher.lua
+++ b/script/core/searcher.lua
@@ -6,6 +6,7 @@ local ws = require 'workspace'
local vm = require 'vm.vm'
local await = require 'await'
local globals = require 'vm.globals'
+local docs = require 'vm.docs'
local NONE = {'NONE'}
local LAST = {'LAST'}
@@ -446,8 +447,12 @@ function m.searchRefsByID(status, uri, expect, mode)
return
end
status.crossed[firstID] = true
+ local uris = docs.getUrisByID(firstID)
+ if not uris then
+ return
+ end
local tid = id .. (field or '')
- for guri in files.eachFile() do
+ for guri in pairs(uris) do
if not files.eq(uri, guri) then
crossSearch(status, guri, tid, mode)
end