generate_queries!() { /* proc-macro */ }Expand description
Generate typed wrappers for tree-sitter queries.
§Parameters
0: Path to the queries, relative to the crate root. Must point to a.scmor directory of.scmfiles. If a directory, this function will generate submodules for each.scm.1: the path to the tree-sitter language root, relative to the crate root. Typicallyvendor/tree-sitter-<language>.2: Path to the crate with the typed node wrappers. Typicallysuper::nodes(and then put an invocation ofgenerate_nodes!at top-level in the sister cratenodes.rs).
§Example
ⓘ
use type_sitter_proc::generate_queries;
generate_queries!("vendor/tree-sitter-typescript/queries/tags.scm", "vendor/tree-sitter-typescript", super::typescript_nodes);
generate_queries!("vendor/tree-sitter-rust/queries", "vendor/tree-sitter-rust", super::rust_nodes);