summaryrefslogtreecommitdiff
path: root/script/core/searcher.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-05-21 18:12:15 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-05-21 18:12:15 +0800
commitf16b28ca0e743b697b443aca693a90f10dd9ec56 (patch)
tree1a04024164a50d3746e10ccdb4f8bfa87223bc08 /script/core/searcher.lua
parent618ba50793225f880ef2fdad38501814fa78a0d6 (diff)
downloadlua-language-server-f16b28ca0e743b697b443aca693a90f10dd9ec56.zip
stash
Diffstat (limited to 'script/core/searcher.lua')
-rw-r--r--script/core/searcher.lua21
1 files changed, 13 insertions, 8 deletions
diff --git a/script/core/searcher.lua b/script/core/searcher.lua
index 9765777c..3ad11e3f 100644
--- a/script/core/searcher.lua
+++ b/script/core/searcher.lua
@@ -217,8 +217,8 @@ function m.searchRefsByID(status, uri, expect, mode)
local mark = {}
local function search(id, field)
- if ignoredIDs[id] then
- --return
+ if ignoredIDs[id] and field then
+ return
end
local cmark = mark[id]
if not cmark then
@@ -460,12 +460,17 @@ function m.searchRefsByID(status, uri, expect, mode)
searchNode(id, node, field)
end
local lastID = checkLastID(id, field)
- if lastID then
- local anyFieldID = lastID .. noder.ANY_FIELD
- local anyFieldNode = noder.getNodeByID(root, anyFieldID)
- if anyFieldNode then
- searchNode(anyFieldID, anyFieldNode, field)
- end
+ if not lastID then
+ return
+ end
+ local originField = id:sub(#lastID + 1)
+ if originField == noder.TABLE_KEY then
+ return
+ end
+ local anyFieldID = lastID .. noder.ANY_FIELD
+ local anyFieldNode = noder.getNodeByID(root, anyFieldID)
+ if anyFieldNode then
+ searchNode(anyFieldID, anyFieldNode, field)
end
end