Make grammar implementation repositories more friendly with tree-sitter Rust bindings #100
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.
Adding a cargo.toml, build.rs, and a lib.rs allows grammar definitions to be added to Rust projects using the tree-sitter Rust bindings easily by adding one dependency to cargo:
[dependencies]tree-sitter-javascript = { git = "https://github.com/racer161/tree-sitter-javascript" }With this edition, the readme.md in tree-sitter/lib/binding_rust/ : https://github.com/tree-sitter/tree-sitter/tree/master/lib/binding_rust will compile without the need for a build.rs or any knowledge of the cc crate. There's also no need to upload these grammar repos to crates.io since they only expose C libraries.
Obviously, this would need to implemented for each grammar repository. I think this makes the most sense to foster support for the rust bindings since its a one time fix (most likely) without need for any further modification. I'd be willing to fork the Javascript, C and Rust repos as a trial so at least the readme in the rust bindings repo would work without knowledge of cc or building.