pub struct SymbolParser { /* private fields */ }Implementations§
Source§impl SymbolParser
impl SymbolParser
pub fn new() -> Self
Sourcepub fn parse_file(&self, path: &Path, content: &str) -> Option<Vec<FlatSymbol>>
pub fn parse_file(&self, path: &Path, content: &str) -> Option<Vec<FlatSymbol>>
Parse symbols from a file.
Returns None when the language is recognized but the grammar shared library
could not be loaded (grammar unavailable at runtime). This is distinct from
returning Some(vec![]) which means the grammar loaded successfully but the
file contains no indexable symbols.
Returns Some(vec![]) (empty) for files whose language is not recognized.
Sourcepub fn parse_imports(&self, path: &Path, content: &str) -> Vec<FlatImport>
pub fn parse_imports(&self, path: &Path, content: &str) -> Vec<FlatImport>
Parse imports from any supported language file. Tries query-based extraction first; falls back to trait-based extraction. Returns a flattened list where each imported name gets its own FlatImport entry.
Sourcepub fn find_symbol(
&mut self,
path: &Path,
content: &str,
name: &str,
) -> Option<FlatSymbol>
pub fn find_symbol( &mut self, path: &Path, content: &str, name: &str, ) -> Option<FlatSymbol>
Find a symbol by name in a file
Sourcepub fn extract_symbol_source(
&mut self,
path: &Path,
content: &str,
name: &str,
) -> Option<String>
pub fn extract_symbol_source( &mut self, path: &Path, content: &str, name: &str, ) -> Option<String>
Extract the source code for a symbol
Sourcepub fn find_callees(
&mut self,
path: &Path,
content: &str,
symbol_name: &str,
) -> Vec<String>
pub fn find_callees( &mut self, path: &Path, content: &str, symbol_name: &str, ) -> Vec<String>
Find callees (functions/methods called) within a symbol
Sourcepub fn find_callees_with_lines(
&mut self,
path: &Path,
content: &str,
symbol_name: &str,
) -> Vec<(String, usize, Option<String>, Option<String>)>
pub fn find_callees_with_lines( &mut self, path: &Path, content: &str, symbol_name: &str, ) -> Vec<(String, usize, Option<String>, Option<String>)>
Find callees with line numbers (for call graph indexing)
Returns: (callee_name, line, Optionaccess is Some("write") when the call result is assigned; None otherwise.
Sourcepub fn find_callees_for_symbol(
&mut self,
path: &Path,
content: &str,
symbol: &FlatSymbol,
) -> Vec<(String, usize, Option<String>, Option<String>)>
pub fn find_callees_for_symbol( &mut self, path: &Path, content: &str, symbol: &FlatSymbol, ) -> Vec<(String, usize, Option<String>, Option<String>)>
Find callees for a pre-parsed symbol (avoids re-parsing the file)
Use this when you already have the FlatSymbol from parse_file()
Returns (callee_name, line, qualifier, access) where access is
Some("write") when the call result is assigned, None otherwise.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SymbolParser
impl RefUnwindSafe for SymbolParser
impl Send for SymbolParser
impl Sync for SymbolParser
impl Unpin for SymbolParser
impl UnsafeUnpin for SymbolParser
impl UnwindSafe for SymbolParser
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request