mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
feat(treesitter): introduce child_with_descendant()
This commit also marks `child_containing_descendant()` as deprecated (per upstream's documentation), and uses `child_with_descendant()` in its place. Minimum required tree-sitter version will now be `0.24`.
This commit is contained in:
committed by
Christian Clason
parent
c4762b3097
commit
267c7525f7
@ -152,8 +152,7 @@ function M.is_ancestor(dest, source)
|
||||
return false
|
||||
end
|
||||
|
||||
-- child_containing_descendant returns nil if dest is a direct parent
|
||||
return source:parent() == dest or dest:child_containing_descendant(source) ~= nil
|
||||
return dest:child_with_descendant(source) ~= nil
|
||||
end
|
||||
|
||||
--- Returns the node's range or an unpacked range table
|
||||
|
Reference in New Issue
Block a user