summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-10-12 20:35:30 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-10-12 20:35:30 +0800
commitb353856c94faa6ec76944f5dea70af3d31a77d14 (patch)
treebe77fc7c5b93b7cd9ee45d3f11106a00370b9056 /script
parent6a894485b4eab731adbbdbf3803dca75dc35e83c (diff)
downloadlua-language-server-b353856c94faa6ec76944f5dea70af3d31a77d14.zip
search fields by chain exp
resolve #1222
Diffstat (limited to 'script')
-rw-r--r--script/vm/field.lua10
1 files changed, 9 insertions, 1 deletions
diff --git a/script/vm/field.lua b/script/vm/field.lua
index b92c3a7b..db53509b 100644
--- a/script/vm/field.lua
+++ b/script/vm/field.lua
@@ -24,11 +24,19 @@ local function searchByLocalID(source, pushResult)
end
end
-local function searchByNode(source, pushResult)
+local function searchByNode(source, pushResult, mark)
+ mark = mark or {}
+ if mark[source] then
+ return
+ end
+ mark[source] = true
local uri = guide.getUri(source)
vm.compileByParentNode(source, nil, true, function (field)
searchByNodeSwitch(field.type, uri, field, pushResult)
end)
+ vm.compileByNodeChain(source, function (src)
+ searchByNode(src, pushResult, mark)
+ end)
end
---@param source parser.object