use crate::config::IndexingConfig;
use crate::types::{Chunk, Language};
pub(crate) fn default_config() -> IndexingConfig {
IndexingConfig::default()
}
pub(crate) fn parse(source: &str, path: &str, lang: Language) -> Vec<Chunk> {
super::parse_and_chunk(source, path, lang, &default_config()).unwrap()
}
pub(crate) fn find_chunk<'a>(chunks: &'a [Chunk], name: &str) -> &'a Chunk {
chunks
.iter()
.find(|c| c.symbol_name.as_deref() == Some(name))
.unwrap_or_else(|| panic!("should find chunk named '{name}'"))
}