diff --git a/lib/binding_rust/lib.rs b/lib/binding_rust/lib.rs index 9245e417..870d177b 100644 --- a/lib/binding_rust/lib.rs +++ b/lib/binding_rust/lib.rs @@ -764,6 +764,7 @@ impl Tree { } } + /// Get the included ranges that were used to parse the syntax tree. pub fn included_ranges(&self) -> Vec { let mut count = 0u32; unsafe { diff --git a/lib/include/tree_sitter/api.h b/lib/include/tree_sitter/api.h index 5e9ce753..bc05bc3c 100644 --- a/lib/include/tree_sitter/api.h +++ b/lib/include/tree_sitter/api.h @@ -381,6 +381,11 @@ TSNode ts_tree_root_node_with_offset( */ const TSLanguage *ts_tree_language(const TSTree *); +/** + * Get the array of included ranges that was used to parse the syntax tree. + * + * The returned pointer must be freed by the caller. + */ TSRange *ts_tree_included_ranges(const TSTree *, uint32_t *length); /**