fix(treesitter): fixup for InspectTree

Fixes #25120

(cherry picked from commit 040cba1faa)
This commit is contained in:
Lewis Russell
2023-09-12 15:26:57 +01:00
committed by github-actions[bot]
parent 57aeacc344
commit f0b1e46f91

View File

@@ -102,7 +102,8 @@ function TSPlayground:new(bufnr, lang)
-- the root in the child tree to the {injections} table.
local root = parser:parse()[1]:root()
local injections = {} ---@type table<integer,table>
parser:for_each_tree(function(tree, ltree)
for _, child in pairs(parser:children()) do
child:for_each_tree(function(tree, ltree)
local r = tree:root()
local node = root:named_descendant_for_range(r:range())
if node then
@@ -112,6 +113,7 @@ function TSPlayground:new(bufnr, lang)
}
end
end)
end
local nodes = traverse(root, 0, parser:lang(), injections, {})