use std::path::Path;
use crate::parsers::lightweight::Language;
pub(super) struct ScanInputs<'a> {
pub path: &'a Path,
pub content: &'a str,
pub ext: &'a str,
}
impl<'a> ScanInputs<'a> {
pub fn new(path: &'a Path, content: &'a str, ext: &'a str) -> Self {
Self { path, content, ext }
}
}
pub(super) struct ScanAstInputs<'a> {
pub scan: ScanInputs<'a>,
pub lang: Language,
pub cached_tree: Option<&'a tree_sitter::Tree>,
}
impl<'a> ScanAstInputs<'a> {
pub fn new(
scan: ScanInputs<'a>,
lang: Language,
cached_tree: Option<&'a tree_sitter::Tree>,
) -> Self {
Self {
scan,
lang,
cached_tree,
}
}
pub fn path(&self) -> &Path {
self.scan.path
}
pub fn content(&self) -> &str {
self.scan.content
}
pub fn ext(&self) -> &str {
self.scan.ext
}
}