Tree Sitter: Add custom predicates.
Review Request #14518 — Created July 26, 2025 and updated — Latest diff uploaded
The nvim-treesitter highlights files that we're using for most of our
supported languages make use of several custom predicates and
directives.This change implements the following:
any-contains?
contains?
gsub!
has-ancestor?
has-parent?
not-has-ancestor?
not-has-parent?
Directives used in queries files which are not (yet) implemented here:
offset!
Predicates and directives implemented in neovim but which are not used
in any of the query files we are using:
any-lua-match?
any-vim-match?
not-vim-match?
vim-match?
trim!
- Ran unit tests.
- Verified that syntax highlighting that used these predicates and
directives worked as expected.