Closed eikopf closed 4 days ago
Found a hacky fix for now: by pointing to the type-sitter
and type-sitter-gen
crates in this repository (rather than on crates.io), the project was able to build. I assume the issue is that the current documentation in the README reflects the current state of the main branch, rather than the published version on crates.io (v0.4.0
).
For now I'll plug in a particular revision to keep my project as stable as possible, but hopefully we get a v0.5.0
release soon?
Hi, sorry for the delay. I was holding off publishing v0.5 until someone asked in case there were any last-minute API changes. I just published everything now.
Note for the version on crates.io, I also updated everything to tree-sitter v0.24 (the latest version) which has some more API changes. Specifically, QueryMatches
and QueryCaptures
are both streaming-iterators. So the version you're pointing to only works with tree-sitter v0.23, and the version on crates.io only works with v0.24.
Also, v0.5 has a lot of its own changes, one of which is that you shouldn't need to put tree-sitter
in Cargo.toml
anymore unless you're also using yak-sitter
, because otherwise everything in tree-sitter is exposed via type_sitter::raw
.
I found that while trying to generate code from a very simple query, the generated code made reference to a
tree_sitter_foobar::language
symbol. My understanding is that this is outdated, and was replaced with theLANGUAGE: LanguageFn
symbol in an older Tree-sitter version.I'm using
tree-sitter v0.22.6
andtype-sitter-gen v0.4.0
. The query I was trying to generate is this:My
build.rs
looks like this:This might just a version mismatch? I'm not sure. It's probably also worth noting that this build script is a component of a lib crate in a larger workspace.
This is the error produced when I run
cargo build
inside the relevant crate: