• 
      

    Tree Sitter: Add custom predicates.

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

    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
    Description From Last Updated

    Note to bump all the 8.0 to 9.0.

    maubin maubin
    david
    david
    maubin
    1. 
        
    2. reviewboard/treesitter/predicates.py (Diff revision 3)
       
       
      Show all issues

      Note to bump all the 8.0 to 9.0.

    3. 
        
    david
    Review request changed
    Status:
    Completed