Expand description
Tree-sitter parsing and chunk extraction for semtree.
Turns source files into structured Chunks -
functions, methods, structs, classes - aligned to real syntax boundaries
instead of arbitrary line windows. Supports Rust, Python, JavaScript,
TypeScript and Go; non-code text falls back to fixed-size windows.
use semtree_parse::extract_file;
let chunks = extract_file(std::path::Path::new("src/lib.rs"))?;
for c in &chunks {
println!("{:?} {:?}", c.kind, c.name);
}Structs§
Enums§
Traits§
Functions§
- chunk_
text - Split plain text into overlapping chunks of ~
chunk_lineslines. - extract_
file - Extract chunks from any supported file - code or plain text.
- is_
text_ file - File types we handle as plain text (no AST)
- parse_
and_ extract - parse_
and_ extract_ file