mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-21 12:50:09 -04:00
Merge metadata from multiple capture nodes
This commit is contained in:
parent
28d480e062
commit
6ba63e4844
1 changed files with 3 additions and 2 deletions
|
|
@ -107,8 +107,9 @@ local get_indents = memoize(function(bufnr, root, lang)
|
||||||
return map
|
return map
|
||||||
end
|
end
|
||||||
for id, node, metadata in query:iter_captures(root, bufnr) do
|
for id, node, metadata in query:iter_captures(root, bufnr) do
|
||||||
if query.captures[id]:sub(1, 1) ~= "_" then
|
local cap, nid = query.captures[id], node:id()
|
||||||
map[query.captures[id]][node:id()] = metadata or {}
|
if cap:sub(1, 1) ~= "_" then
|
||||||
|
map[cap][nid] = vim.tbl_extend("force", map[cap][nid] or {}, metadata or {})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue