Pin tree-sitter to 0.20.4 for OSS and internal (#117)#117
Closed
mgrange1998 wants to merge 1 commit into
Closed
Conversation
|
@mgrange1998 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D98013757. |
mgrange1998
added a commit
to mgrange1998/PrivacyGuard-1
that referenced
this pull request
Mar 24, 2026
Summary: ## Problem The tree-sitter 0.25.0 API changed `Language.__init__` to require a `name` parameter, breaking our code that passes only a capsule pointer. ## Solution - Pin tree-sitter to 0.20.4 in both PACKAGE files and pyproject.toml - Add `_language_from_capsule()` compatibility shim that extracts the raw pointer from the PyCapsule returned by tree-sitter-python/cpp language packages and constructs a Language object compatible with 0.20.4 - Switch from `Parser(language)` to `Parser()` + `parser.set_language()` (0.20.4 API) Differential Revision: D98013757
274605c to
09c60b0
Compare
Summary: ## Problem The tree-sitter 0.25.0 API changed `Language.__init__` to require a `name` parameter, breaking our code that passes only a capsule pointer. ## Solution - Pin tree-sitter to 0.20.4 in both PACKAGE files and pyproject.toml - Add `_language_from_capsule()` compatibility shim that extracts the raw pointer from the PyCapsule returned by tree-sitter-python/cpp language packages and constructs a Language object compatible with 0.20.4 - Switch from `Parser(language)` to `Parser()` + `parser.set_language()` (0.20.4 API) Differential Revision: D98013757
09c60b0 to
11a3205
Compare
|
This pull request has been merged in 9ad0fc7. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Problem
The tree-sitter 0.25.0 API changed
Language.__init__to require anameparameter, breaking our code that passes only a capsule pointer.Solution
_language_from_capsule()compatibility shim that extracts the raw pointer from the PyCapsule returned by tree-sitter-python/cpp language packages and constructs a Language object compatible with 0.20.4Parser(language)toParser()+parser.set_language()(0.20.4 API)Differential Revision: D98013757