pub struct FileParser { /* private fields */ }Expand description
Core parsing engine. Handles language detection, parse tree caching, symbol table caching, and query pattern execution via tree-sitter.
Implementations§
Source§impl FileParser
impl FileParser
Sourcepub fn set_warm_cache(&mut self, cache: SymbolCache)
pub fn set_warm_cache(&mut self, cache: SymbolCache)
Attach a pre-warmed symbol cache from background indexing.
Sourcepub fn parse(&mut self, path: &Path) -> Result<(&Tree, LangId), AftError>
pub fn parse(&mut self, path: &Path) -> Result<(&Tree, LangId), AftError>
Parse a file, returning the tree and detected language. Uses cache if the file hasn’t been modified since last parse.
Sourcepub fn parse_cloned(&mut self, path: &Path) -> Result<(Tree, LangId), AftError>
pub fn parse_cloned(&mut self, path: &Path) -> Result<(Tree, LangId), AftError>
Like FileParser::parse but returns an owned Tree clone.
Useful when the caller needs to hold the tree while also calling other mutable methods on this parser.
Sourcepub fn extract_symbols(&mut self, path: &Path) -> Result<Vec<Symbol>, AftError>
pub fn extract_symbols(&mut self, path: &Path) -> Result<Vec<Symbol>, AftError>
Extract symbols from a file using language-specific query patterns.
Results are cached by (path, mtime) — subsequent calls for unchanged
files return the cached symbol table without re-parsing.
Sourcepub fn invalidate_symbols(&mut self, path: &Path)
pub fn invalidate_symbols(&mut self, path: &Path)
Invalidate cached symbols for a specific file (e.g., after an edit).
Auto Trait Implementations§
impl Freeze for FileParser
impl RefUnwindSafe for FileParser
impl Send for FileParser
impl Sync for FileParser
impl Unpin for FileParser
impl UnsafeUnpin for FileParser
impl UnwindSafe for FileParser
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more