build(deps): Update tree-sitter to 0.26.3 and related dependencies#1207
build(deps): Update tree-sitter to 0.26.3 and related dependencies#1207marco-c merged 3 commits intomozilla:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates tree-sitter from 0.25.3 to 0.26.3 and related language grammar dependencies to maintain compatibility with the new tree-sitter version.
Changes:
- Updated tree-sitter core library and language grammars (JavaScript, Python, Rust) to their latest versions
- Adapted code to handle tree-sitter 0.26 API changes where
Node.child()now expectsu32instead ofusize - Applied clippy fixes using let-chain syntax to simplify nested if-let patterns
- Regenerated language enum files from updated grammars
Reviewed changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 23 comments.
Show a summary per file
| File | Description |
|---|---|
| Cargo.toml | Updated tree-sitter and language grammar dependencies to latest versions |
| enums/Cargo.toml | Updated tree-sitter, askama, and language grammar dependencies |
| tree-sitter-*/Cargo.toml | Updated tree-sitter dev-dependencies in subcrates |
| src/node.rs | Added u32 cast for Node.child() and explicit lifetime annotations |
| src/traits.rs | Added explicit lifetime annotation to get_root() return type |
| src/parser.rs | Added explicit lifetime annotation to get_root() return type |
| src/tools.rs | Applied clippy fix for collapsible_if pattern |
| src/metrics/*.rs | Applied clippy fixes converting nested if-let to let-chain syntax |
| src/getter.rs | Applied clippy fixes converting nested if-let to let-chain syntax |
| src/find.rs | Applied clippy fix converting nested if-let to let-chain syntax |
| src/checker.rs | Applied clippy fix converting nested if-let to let-chain syntax |
| src/alterator.rs | Applied clippy fix converting nested if-let to let-chain syntax |
| src/languages/*.rs | Regenerated language enum files with updated grammar node types |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cfe33ee to
8d1e922
Compare
|
Thank you! Could you move all the |
Update major dependencies: - tree-sitter: 0.25.3 -> 0.26.3 - tree-sitter-javascript: 0.23.1 -> 0.25.0 - tree-sitter-python: 0.23.6 -> 0.25.0 - tree-sitter-rust: 0.23.2 -> 0.24.0 - askama: 0.14 -> 0.15 Also update tree-sitter version in all subcrates. Regenerate language enums to match new grammar versions. Fix tree-sitter API change: Node.child() now takes u32 instead of usize.
8d1e922 to
dc31713
Compare
|
Done! Clippy fixes have been moved to a separate PR: #1211 This PR now only contains the dependency version updates and the minimal code changes required for tree-sitter 0.26.3 API compatibility ( |
|
This PR is failing CI due to 18 pre-existing clippy warnings in the upstream codebase (e.g., These warnings are not introduced by this PR - they exist in the current Dependency: This PR requires #1211 to be merged first for CI to pass. What this PR actually changes:
Once #1211 is merged, this PR's CI should pass. |
|
Sorry, I forgot we also need to bump the versions of tree-sitter-preproc, tree-sitter-ccomment, tree-sitter-mozcpp, tree-sitter-mozjs, like #1165 was doing. |
|
From a quick glance at the updated grammars, I see only improvements. |
Summary
Update major dependencies to their latest versions:
tree-sitter: 0.25.3 → 0.26.3tree-sitter-javascript: 0.23.1 → 0.25.0tree-sitter-python: 0.23.6 → 0.25.0tree-sitter-rust: 0.23.2 → 0.24.0askama: 0.14 → 0.15Also updates tree-sitter version in all subcrates (tree-sitter-preproc, tree-sitter-ccomment, tree-sitter-mozcpp, tree-sitter-mozjs).
Changes
Node.child()now takesu32instead ofusizein tree-sitter 0.26Testing
cargo checkpassescargo clippy -- -D warningspassesThis PR is part of splitting #1206 into separate focused PRs as requested.