Skip to content

Conversation

@sion-codin
Copy link
Contributor

Add text property to the Node class.

issue:#40

You can refer to this PR in the Python binding for review.

@mattmassicotte
Copy link
Contributor

Thanks for this!

Capturing the immutable state as part of the tree formation is clever. I think that technically, text could be resolvable even if the source string is lost, via edit-range translations. I do this my own use, but it's kinda hard to for me to even decide if that would have any advantages over this mechanism. Plus, if it did, I think it could be implemented in an API-compatible way.

It's possible this could also be a good path towards simplifying query predicate resolution. Though I'd have to think more on that one. But, not important for this particular change.

@mattmassicotte mattmassicotte merged commit 114a515 into tree-sitter:main Sep 28, 2025
7 checks passed
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.

2 participants