aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/treesitter.lua
diff options
context:
space:
mode:
authorRiley Bruins <ribru17@hotmail.com>2024-10-02 10:34:14 -0700
committerChristian Clason <c.clason@uni-graz.at>2024-10-11 17:29:45 +0200
commit267c7525f738cdd6024c39da758e885c026ffaaa (patch)
tree869fcb5fa87b4f9b2c4f0a0295498c5ed2883b73 /runtime/lua/vim/treesitter.lua
parentc4762b309714897615607f135aab9d7bcc763c4f (diff)
downloadrneovim-267c7525f738cdd6024c39da758e885c026ffaaa.tar.gz
rneovim-267c7525f738cdd6024c39da758e885c026ffaaa.tar.bz2
rneovim-267c7525f738cdd6024c39da758e885c026ffaaa.zip
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`.
Diffstat (limited to 'runtime/lua/vim/treesitter.lua')
-rw-r--r--runtime/lua/vim/treesitter.lua3
1 files changed, 1 insertions, 2 deletions
diff --git a/runtime/lua/vim/treesitter.lua b/runtime/lua/vim/treesitter.lua
index ed7d31e1f7..4727c0d61d 100644
--- a/runtime/lua/vim/treesitter.lua
+++ b/runtime/lua/vim/treesitter.lua
@@ -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