pub struct AstParser { /* private fields */ }
Expand description
Tree-sitter based AST parser and analyzer
Implementations§
Source§impl AstParser
impl AstParser
Sourcepub fn parse_chunks(
&mut self,
content: &str,
file_path: &str,
) -> Result<Vec<AstChunk>>
pub fn parse_chunks( &mut self, content: &str, file_path: &str, ) -> Result<Vec<AstChunk>>
Parse code into chunks using tree-sitter AST
Sourcepub fn extract_imports(
&self,
content: &str,
language: AstLanguage,
) -> Result<Vec<AstImport>>
pub fn extract_imports( &self, content: &str, language: AstLanguage, ) -> Result<Vec<AstImport>>
Extract signatures using tree-sitter AST Extract imports from the given content using optimized tree-sitter traversal
pub fn extract_signatures( &mut self, content: &str, file_path: &str, ) -> Result<Vec<AstSignature>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AstParser
impl RefUnwindSafe for AstParser
impl Send for AstParser
impl Sync for AstParser
impl Unpin for AstParser
impl UnwindSafe for AstParser
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