summaryrefslogtreecommitdiff
path: root/script/vm
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-01-19 18:04:00 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-01-19 18:04:00 +0800
commit021ceef2e05c781e849e1bac86eaae6e36775cf9 (patch)
tree7fb2371f2377c624f9d7a71e1e1fce2b07adde4e /script/vm
parentd6859305513099d125f6dad69cb35f29b796bebf (diff)
downloadlua-language-server-021ceef2e05c781e849e1bac86eaae6e36775cf9.zip
stash
Diffstat (limited to 'script/vm')
-rw-r--r--script/vm/getDocs.lua8
-rw-r--r--script/vm/getGlobals.lua8
2 files changed, 8 insertions, 8 deletions
diff --git a/script/vm/getDocs.lua b/script/vm/getDocs.lua
index c635b2a9..cfad021c 100644
--- a/script/vm/getDocs.lua
+++ b/script/vm/getDocs.lua
@@ -3,7 +3,7 @@ local guide = require 'parser.guide'
---@class vm
local vm = require 'vm.vm'
local config = require 'config'
-local collector = require 'core.collector'
+local collector = require 'core.collector' 'searcher'
local define = require 'proto.define'
local noder = require 'core.noder'
@@ -17,7 +17,7 @@ function vm.getDocDefines(uri, name)
end
local results = {}
if name == '*' then
- for noders in collector.each(uri, '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(uri, name)
end
else
local id = 'dn:' .. name
- for noders in collector.each(uri, '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
@@ -49,7 +49,7 @@ function vm.isDocDefined(name)
return true
end
local id = 'def:dn:' .. name
- if collector.has(id) then
+ if collector:has(id) then
return true
end
return false
diff --git a/script/vm/getGlobals.lua b/script/vm/getGlobals.lua
index f6646559..b9ddedab 100644
--- a/script/vm/getGlobals.lua
+++ b/script/vm/getGlobals.lua
@@ -1,4 +1,4 @@
-local collector = require 'core.collector'
+local collector = require 'core.collector' 'searcher'
local guide = require 'parser.guide'
---@class vm
local vm = require 'vm.vm'
@@ -11,7 +11,7 @@ function vm.hasGlobalSets(name)
else
id = ('def:g:%s'):format(noder.STRING_CHAR, name)
end
- return collector.has(id)
+ return collector:has(id)
end
function vm.getGlobalSets(uri, name)
@@ -22,7 +22,7 @@ function vm.getGlobalSets(uri, name)
local results = {}
cache[name] = results
if name == '*' then
- for noders in collector.each(uri, '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(uri, name)
else
id = ('g:%s'):format(noder.STRING_CHAR, name)
end
- for noders in collector.each(uri, '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