summaryrefslogtreecommitdiff
path: root/script/vm
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2021-11-27 20:24:44 +0800
committersumneko <sumneko@hotmail.com>2021-11-27 20:24:44 +0800
commitec5b8daefb47cf1808539524fca458671c3b14a5 (patch)
treeb2569ee4948622eb63ce2bacb2f56a336ccac123 /script/vm
parentd059e2b88c755d9f8344e6702d17763257285fc2 (diff)
downloadlua-language-server-ec5b8daefb47cf1808539524fca458671c3b14a5.zip
split searcher
Diffstat (limited to 'script/vm')
-rw-r--r--script/vm/getDocs.lua6
-rw-r--r--script/vm/getGlobals.lua6
2 files changed, 6 insertions, 6 deletions
diff --git a/script/vm/getDocs.lua b/script/vm/getDocs.lua
index 544c1f60..f179c684 100644
--- a/script/vm/getDocs.lua
+++ b/script/vm/getDocs.lua
@@ -10,14 +10,14 @@ local noder = require 'core.noder'
---获取class与alias
---@param name? string
---@return parser.guide.object[]
-function vm.getDocDefines(name)
+function vm.getDocDefines(uri, name)
local cache = vm.getCache 'getDocDefines'
if cache[name] then
return cache[name]
end
local results = {}
if name == '*' then
- for noders in collector.each('def:dn:') do
+ for noders in collector.each(uri, 'def:dn:') do
for id in noder.eachID(noders) do
if id:sub(1, 3) == 'dn:'
and not id:find(noder.SPLIT_CHAR) then
@@ -31,7 +31,7 @@ function vm.getDocDefines(name)
end
else
local id = 'dn:' .. name
- for noders in collector.each('def:' .. id) do
+ for noders in collector.each(uri, 'def:' .. id) do
for source in noder.eachSource(noders, id) do
if source.type == 'doc.class.name'
or source.type == 'doc.alias.name' then
diff --git a/script/vm/getGlobals.lua b/script/vm/getGlobals.lua
index 92fd1c8e..f6646559 100644
--- a/script/vm/getGlobals.lua
+++ b/script/vm/getGlobals.lua
@@ -14,7 +14,7 @@ function vm.hasGlobalSets(name)
return collector.has(id)
end
-function vm.getGlobalSets(name)
+function vm.getGlobalSets(uri, name)
local cache = vm.getCache 'getGlobalSets'
if cache[name] then
return cache[name]
@@ -22,7 +22,7 @@ function vm.getGlobalSets(name)
local results = {}
cache[name] = results
if name == '*' then
- for noders in collector.each('def:g:') do
+ for noders in collector.each(uri, 'def:g:') do
for id in noder.eachID(noders) do
if id:sub(1, 2) == 'g:'
and not id:find(noder.SPLIT_CHAR) then
@@ -41,7 +41,7 @@ function vm.getGlobalSets(name)
else
id = ('g:%s'):format(noder.STRING_CHAR, name)
end
- for noders in collector.each('def:' .. id) do
+ for noders in collector.each(uri, 'def:' .. id) do
for source in noder.eachSource(noders, id) do
if guide.isSet(source) then
results[#results+1] = source