-
-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…and update our API usages. Tree-sitter harmonized the API differences between `web-tree-sitter` and `node-tree-sitter` in version 0.22.0. This is the first time we’ve had to deal with that. Luckily, the changes were mostly palatable. The biggest API difference is in `Query#captures`; two positional arguments for defining the extent of the query have been moved to keyword arguments. We’ve updated our internal usages, but any community packages that relied on the old function signature would break if we didn’t do anything about it. So we’ve wrapped the `Query#captures` method in one of our own; it detects usages that expect the old signature and rearranges their arguments, issuing a deprecation warning in the process. Hopefully this generates enough noise that any such packages understand what’s going on and can update. Other API changes are more obscure — which is good, because we can’t wrap them the way we wrapped `Query#captures`. They involve conversion of functions to getters (`node.hasErrors` instead of `node.hasErrors()`), and there’s no good way to make both usages work… short of wrapping nodes in `Proxy` objects, and that’s not on the table. Since lots has changed in `tree-sitter` since we last upgraded `web-tree-sitter`, I updated our documentation about building a custom version of `web-tree-sitter`.
- Loading branch information
1 parent
26be874
commit 87a9322
Showing
8 changed files
with
3,430 additions
and
3,278 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.