Skip to content

Conversation

@marlon-costa-dc
Copy link
Contributor

Summary

This PR updates tree-sitter from 0.25.x to 0.26.3 and updates all related grammar dependencies. It builds upon the work started in PR #1165 by @alexle0nte.

Dependency updates:

  • tree-sitter: 0.25.3 → 0.26.3
  • tree-sitter-kotlin: switched from tree-sitter-kotlin-ng to tree-sitter-kotlin-codanna 0.3.9
  • tree-sitter-javascript: updated to 0.25.0
  • tree-sitter-python: updated to 0.25.0
  • tree-sitter-rust: updated to 0.24.0

Origin

Based on PR #1165 by @alexle0nte which updated tree-sitter to 0.25.4. This PR:

  1. Takes that base and updates to tree-sitter 0.26.3
  2. Switches Kotlin grammar to tree-sitter-kotlin-codanna (more actively maintained)
  3. Fixes API compatibility issues introduced in tree-sitter 0.26

What it does

  1. Updates all Cargo.toml files with new dependency versions
  2. Regenerates language enum files in src/languages/ for updated grammars
  3. Fixes tree-sitter 0.26 API changes:
    • Node::child() now requires u32 parameter (was usize)
  4. Adds macro case for Kotlin grammar:
    • tree_sitter_kotlin_codanna::language() instead of ::LANGUAGE constant

Implementation decisions

Why tree-sitter-kotlin-codanna?

The previous tree-sitter-kotlin-ng crate is no longer maintained. tree-sitter-kotlin-codanna (v0.3.9) provides:

  • Active maintenance
  • tree-sitter 0.26 compatibility
  • Uses language() function instead of LANGUAGE constant

API compatibility fix

Tree-sitter 0.26 changed Node::child(index) to require u32:

// Before (tree-sitter 0.25.x)
self.0.child(pos).map(Node)

// After (tree-sitter 0.26.x)
self.0.child(pos as u32).map(Node)

Macro changes

Added special case in get_language! macro for Kotlin:

(tree_sitter_kotlin_codanna) => {
    tree_sitter_kotlin_codanna::language().into()
};

Related PRs

Test plan

  • All grammar crates compile successfully
  • Main library compiles without errors
  • Only warnings are pre-existing lifetime elision suggestions
  • Run full test suite

🤖 Generated with Claude Code

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates tree-sitter from 0.25.3 to 0.26.3 and updates all related grammar dependencies. The changes include switching the Kotlin grammar from the unmaintained tree-sitter-kotlin-ng to tree-sitter-kotlin-codanna v0.3.9, updating JavaScript, Python, and Rust grammars, and making necessary API compatibility changes for tree-sitter 0.26.

Changes:

  • Updates tree-sitter core to 0.26.3 and adapts code for API breaking changes (Node::child now requires u32)
  • Switches Kotlin grammar to tree-sitter-kotlin-codanna with updated macro support
  • Updates grammar dependencies: JavaScript (0.25.0), Python (0.25.0), Rust (0.24.0), and regenerates language enum files

Reviewed changes

Copilot reviewed 33 out of 34 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
Cargo.toml Updates tree-sitter to 0.26.3 and grammar dependencies
enums/Cargo.toml Updates tree-sitter and grammar dependencies for enums crate
src/node.rs Adds u32 cast for Node::child() API change
src/macros.rs Adds Kotlin grammar special case macro
src/tools.rs Removes redundant parentheses (style improvement)
src/langs.rs Updates Kotlin grammar reference
enums/src/macros.rs Updates Kotlin grammar reference
enums/src/languages.rs Updates Kotlin grammar reference
tree-sitter-*/Cargo.toml Bumps versions and updates tree-sitter dev-dependency
tree-sitter-*/package.json Updates tree-sitter-cli to 0.25.4
tree-sitter-*/bindings/rust/README.md Documentation (needs updating)
tree-sitter-*/src/parser.c Regenerated parser files
tree-sitter-*/src/tree_sitter/parser.h Removes duplicate typedef declaration
src/languages/*.rs Regenerated language enum files from updated grammars
.claude/* Development cache files (should not be committed)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Update tree-sitter from 0.25.4 to 0.26.3
- Switch tree-sitter-kotlin-ng to tree-sitter-kotlin-codanna 0.3.9
- Update tree-sitter-javascript to 0.25.0
- Update tree-sitter-python to 0.25.0
- Update tree-sitter-rust to 0.24.0
- Regenerate language enums for all grammars
- Fix Node::child() parameter type for tree-sitter 0.26 API
marlon-costa-dc and others added 5 commits January 20, 2026 14:25
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants