• 
      

    Tree Sitter: Copy some queries out of upstream grammars.

    Review Request #14526 — Created July 28, 2025 and submitted

    Information

    Review Board
    master

    Reviewers

    We get most of our queries files from nvim-treesitter, because those
    tend to be much higher quality, but that doesn't work for everything. In
    some cases, nvim-treesitter uses a different grammar implementation than
    tree-sitter-language-pack (for example, there are two different
    packages named tree-sitter-scss which are incompatible). In other
    cases, we may encounter version issues, or just broken files.

    This change makes it so we can get queries for specific languages out of
    the grammar implementations used from the update-language-info.py
    script. This will update the same lock file as the update-queries.py
    script, so we know where each and every third-party query file comes
    from.

    This also renames the queries lock file from nvim-treesitter.lock to
    queries.lock, and simplifies the format so it just lists each file
    along with its source git repo URL and commit ID.

    The new queries files themselves will be in a separate commit.

    Ran the update-queries and update-language-info scripts and saw all the new
    queries files and updated lockfile.

    Summary ID
    Tree Sitter: Copy some queries out of upstream grammars.
    We get most of our queries files from `nvim-treesitter`, because those tend to be much higher quality, but that doesn't work for everything. In some cases, `nvim-treesitter` uses a different grammar implementation than `tree-sitter-language-pack` (for example, there are two different packages named `tree-sitter-scss` which are incompatible). In other cases, we may encounter version issues, or just broken files. This change makes it so we can get queries for specific languages out of the grammar implementations used from the update-language-info.py script. This will update the same lock file as the update-queries.py script, so we know where each and every third-party query file comes from. This also renames the queries lock file from `nvim-treesitter.lock` to `queries.lock`, and simplifies the format so it just lists each file along with its source git repo URL and commit ID. Testing Done: Ran the update-queries and update-language-info scripts and saw all the new queries files and updated lockfile.
    ed7aec0c84a977ad2410a94776ddc02c01534f38
    Description From Last Updated

    A thought on all these scripts: I think it'd be worthwhile to add a Markdown file with instructions on what …

    maubin maubin

    We have the same function defined in update-queries.py. We couls pull this and other duplicated functions out into a util …

    maubin maubin
    maubin
    1. 
        
    2. Show all issues

      A thought on all these scripts: I think it'd be worthwhile to add a Markdown file with instructions on what order to run the scripts in (if the order matters) and just any steps/notes that one would need to remember when running these scripts.

      1. I'll add some docs for all the scripts in another change.

    3. Show all issues

      We have the same function defined in update-queries.py. We couls pull this and other duplicated functions out into a util file.

      1. Because contrib/internal/ isn't actually a module, that's not the easiest thing to do. I'll think about it and if I come up with something, I'd like to do that cleanup separately.

    4. 
        
    maubin
    1. Ship It!
    2. 
        
    david
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to master (b69e2f2)