feat: Expose inner tree-sitter::Node for advanced use cases#1210
feat: Expose inner tree-sitter::Node for advanced use cases#1210marco-c merged 4 commits intomozilla:masterfrom
Conversation
Makes the inner tree_sitter::Node field public to allow direct access to the underlying tree-sitter API for advanced use cases. Based on WalkerKnapp/rust-code-analysis@026e424
There was a problem hiding this comment.
Pull request overview
This PR exposes the inner tree_sitter::Node field to allow advanced users direct access to the underlying tree-sitter API. This enables integration with other tree-sitter-based tools and access to methods not wrapped by rust-code-analysis.
Changes:
- Made the inner field of the
Nodetuple struct public - Added documentation explaining the exposed field's purpose
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fix mismatched_lifetime_syntaxes warnings by adding explicit <'_> lifetime annotations to return types where the lifetime is elided. Files modified: - src/node.rs: get_root(), child_by_field_name() - src/traits.rs: ParserTrait::get_root() - src/parser.rs: TSParser::get_root()
21d1c0a to
f7ea18e
Compare
|
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. |
|
You can rebase this PR |
Summary
Makes the inner
tree_sitter::Nodefield public to allow direct access to the underlying tree-sitter API for advanced use cases.This enables users to:
Changes
src/node.rs: ChangedNode<'a>(OtherNode<'a>)toNode<'a>(pub OtherNode<'a>)Attribution
Based on WalkerKnapp/rust-code-analysis@026e424 - "Allow conversion from tree-sitter AST"
Test plan
cargo checkpasses