mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00

committed by
Lewis Russell

parent
bc67cf3ccd
commit
1f551e068f
@@ -101,7 +101,8 @@ function TSTreeView:new(bufnr, lang)
|
|||||||
-- the root in the child tree to the {injections} table.
|
-- the root in the child tree to the {injections} table.
|
||||||
local root = parser:parse(true)[1]:root()
|
local root = parser:parse(true)[1]:root()
|
||||||
local injections = {} ---@type table<integer,table>
|
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 r = tree:root()
|
||||||
local node = root:named_descendant_for_range(r:range())
|
local node = root:named_descendant_for_range(r:range())
|
||||||
if node then
|
if node then
|
||||||
@@ -111,6 +112,7 @@ function TSTreeView:new(bufnr, lang)
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
local nodes = traverse(root, 0, parser:lang(), injections, {})
|
local nodes = traverse(root, 0, parser:lang(), injections, {})
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user