• 
      

    Tree Sitter: Add custom predicates.

    Review Request #14518 — Created July 26, 2025 and updated

    Information

    Review Board
    master

    Reviewers

    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.
    Summary ID
    Tree Sitter: Add custom predicates.
    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!` Testing Done: - Ran unit tests. - Verified that syntax highlighting that used these predicates and directives worked as expected.
    vkxqvvunzxwupzuxkoypoutsqntnpomp
    david
    david
    Review request changed
    Change Summary:

    Add to coderef.

    Commits:
    Summary ID
    Tree Sitter: Add custom predicates.
    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!` Testing Done: - Ran unit tests. - Verified that syntax highlighting that used these predicates and directives worked as expected.
    e83627bed8199ae25be6567922e15910aa5aec99
    Tree Sitter: Add custom predicates.
    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!` Testing Done: - Ran unit tests. - Verified that syntax highlighting that used these predicates and directives worked as expected.
    vkxqvvunzxwupzuxkoypoutsqntnpomp

    Checks run (2 succeeded)

    flake8 passed.
    JSHint passed.