-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump tree-sitter to 0.24 (not a release) #794
Bump tree-sitter to 0.24 (not a release) #794
Conversation
Biggest difficulty is that `tree_sitter::QueryMatches` is now a `StreamingIterator`, returning references rather than values. This makes it very difficult to store in a new type. Instead make `topiary_tree_sitter_facade::QueryMatch` a trait rather than a new type. This seems to be the easiest way to preserve as much of the existing structure as possible. Not tested for the wasm32 build, so possibly some changes required there to match.
Thank you for your contribution, @ZedThree 🙏 Will bumping to Tree-sitter 0.24 affect the grammars we support that, currently, haven't themselves upgraded to 0.24 (or maybe 0.23, I think you said, was where this transitive dependency problem was dropped)? As of writing, it looks like the default branches for the following grammars use:
I suspect that the dynamic loading may have resolved this problem regardless, as I would try this out myself, but unfortunately, I cannot get your fork to build: $ cargo build
+ command cargo build
Compiling topiary-config v0.5.1 (/home/chris/Projects/tweag/topiary/forks/PlasmaFAIR/topiary-config)
error[E0277]: the trait bound `topiary_tree_sitter_facade::Language: From<tree_sitter::Language>` is not satisfied
--> topiary-config/src/language.rs:164:12
|
164 | Ok(topiary_tree_sitter_facade::Language::from(language))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<tree_sitter::Language>` is not implemented for `topiary_tree_sitter_facade::Language`
|
= help: the trait `From<tree_sitter_language::LanguageFn>` is implemented for `topiary_tree_sitter_facade::Language`
= help: for that trait implementation, expected `tree_sitter_language::LanguageFn`, found `tree_sitter::Language`
For more information about this error, try `rustc --explain E0277`.
error: could not compile `topiary-config` (lib) due to 1 previous error
$ rustc --version
rustc 1.79.0 (129f3b996 2024-06-10) (built from a source tarball) Footnotes
|
There's something wrong with the CI. I wonder if it thinks it's a release because of the version number in the title? |
@Xophmeister Fixed! Sorry, I was just being lazy and only building I'm pretty sure it's using all of the languages, so it doesn't seem to be a problem that some of the languages are on earlier tree-sitter versions? Just had a quick look into this, and the |
@yannham IIRC not all CI jobs will run against forks. I believe this is to prevent bad actors from DDOS'ing a GitHub org's CI minutes, but the criteria for what runs or not is a mystery to me 🤷 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @ZedThree 🙏
I've made a few suggestions where the formatter complains. Nothing significant, but it's preventing the CI tests (nix -L flake check
) from passing locally.
Otherwise, as you say, it looks like all the other language formatters are working properly, despite being from different versions.
@ZedThree Please could you also mention this change in the |
Formatting done and changelog updated 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. Thanks for contributing @ZedThree!
I figured out why your CI isn't running properly: it only runs on topiary/.github/workflows/ci.yml Line 1 in 4dcdc0a
You probably want it to also run on |
Bump tree-sitter to 0.24
Closes #684
Description
Biggest difficulty is that
tree_sitter::QueryMatches
is now aStreamingIterator
, returning references rather than values. This makes it very difficult to store in a new type.Instead make
topiary_tree_sitter_facade::QueryMatch
a trait rather than a new type. This seems to be the easiest way to preserve as much of the existing structure as possible.Not tested for the wasm32 build, so possibly some changes required there to match.
Checklist
Checklist before merging: