diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-10-12 20:35:30 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-10-12 20:35:30 +0800 |
commit | b353856c94faa6ec76944f5dea70af3d31a77d14 (patch) | |
tree | be77fc7c5b93b7cd9ee45d3f11106a00370b9056 /script | |
parent | 6a894485b4eab731adbbdbf3803dca75dc35e83c (diff) | |
download | lua-language-server-b353856c94faa6ec76944f5dea70af3d31a77d14.zip |
search fields by chain exp
resolve #1222
Diffstat (limited to 'script')
-rw-r--r-- | script/vm/field.lua | 10 |
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 |