summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-01-05 15:19:39 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-01-05 15:19:39 +0800
commit6b0d81352225c5d383f0f81eadae24915bc40116 (patch)
tree29f08c108a1d55b2ad7393b7dc4e752ad6e51188 /script/core
parent88ad1dcbab24491726fbdc51a93afd599ecc12a1 (diff)
downloadlua-language-server-6b0d81352225c5d383f0f81eadae24915bc40116.zip
cleanup
Diffstat (limited to 'script/core')
-rw-r--r--script/core/collector.lua25
-rw-r--r--script/core/searcher.lua8
2 files changed, 2 insertions, 31 deletions
diff --git a/script/core/collector.lua b/script/core/collector.lua
index 43e584d5..57ae3adc 100644
--- a/script/core/collector.lua
+++ b/script/core/collector.lua
@@ -160,29 +160,4 @@ function m.each(uri, name)
return eachOfFallback(nameCollect, scope.fallback)
end
---- 迭代某个名字的引用订阅
----@param uri uri
----@param name string
-function m.eachRef(uri, name)
- local nameCollect = collect[name]
- if not nameCollect then
- return DUMMY_FUNCTION
- end
- ---@type scope
- if scope.getFolder(uri) then
- return m.each(uri, name)
- end
-
- local curi, value
- local function getNext()
- curi, value = next(nameCollect, curi)
- if not curi then
- return nil, nil
- end
-
- return value, curi
- end
- return getNext
-end
-
return m
diff --git a/script/core/searcher.lua b/script/core/searcher.lua
index 10f1d3db..5beaf26b 100644
--- a/script/core/searcher.lua
+++ b/script/core/searcher.lua
@@ -24,10 +24,8 @@ local sfind = string.find
local sformat = string.format
local getUri = guide.getUri
-local getRoot = guide.getRoot
local ceach = collector.each
-local ceachref = collector.each
local getState = files.getState
@@ -44,8 +42,6 @@ local eachBackward = noder.eachBackward
local eachExtend = noder.eachExtend
local eachSource = noder.eachSource
local compileAllNodes = noder.compileAllNodes
-local compilePartNoders = noder.compilePartNodes
-local isGlobalID = noder.isGlobalID
local hasCall = noder.hasCall
local SPLIT_CHAR = noder.SPLIT_CHAR
@@ -845,7 +841,7 @@ function m.searchRefsByID(status, suri, expect, mode)
::CONTINUE::
end
else
- for _, guri in ceachref(suri, id) do
+ for _, guri in ceach(suri, id) do
if crossed[guri] then
goto CONTINUE
end
@@ -881,7 +877,7 @@ function m.searchRefsByID(status, suri, expect, mode)
::CONTINUE::
end
else
- for _, guri in ceachref(suri, id) do
+ for _, guri in ceach(suri, id) do
if crossed[guri] then
goto CONTINUE
end