pub struct SemanticSearcher { /* private fields */ }Expand description
Semantic code searcher: fuses Ripgrep speed with Tree-sitter precision.
Implementations§
Source§impl SemanticSearcher
impl SemanticSearcher
pub fn new() -> Self
Sourcepub fn list_symbols(&mut self, path: &Path) -> Option<Vec<Symbol>>
pub fn list_symbols(&mut self, path: &Path) -> Option<Vec<Symbol>>
List all top-level symbols in a file. Returns function/class/struct signatures with line ranges.
Sourcepub fn extract_symbol(
&mut self,
path: &Path,
symbol_name: &str,
) -> Option<SymbolSlice>
pub fn extract_symbol( &mut self, path: &Path, symbol_name: &str, ) -> Option<SymbolSlice>
Extract a specific symbol (function/class) by name from a file. Returns the complete source text of that symbol.
Sourcepub fn skeleton(&mut self, path: &Path) -> Option<String>
pub fn skeleton(&mut self, path: &Path) -> Option<String>
Generate a skeleton of a file: signatures only, bodies replaced with { … }.
Sourcepub fn invalidate(&mut self, path: &Path)
pub fn invalidate(&mut self, path: &Path)
Invalidate cache for a file (call after edit_file).
Sourcepub fn count_syntax_errors(
&mut self,
source: &str,
path: &Path,
) -> (usize, Vec<usize>)
pub fn count_syntax_errors( &mut self, source: &str, path: &Path, ) -> (usize, Vec<usize>)
Count ERROR nodes in source code. Language-agnostic. Returns (error_count, first few error line numbers).
Sourcepub fn find_similar_calls(
&mut self,
path: &Path,
pattern: &str,
) -> Option<String>
pub fn find_similar_calls( &mut self, path: &Path, pattern: &str, ) -> Option<String>
Find all call sites in a file that match a pattern (e.g., “tagRepository”) and report their line numbers and enclosing function.
Language-agnostic: works on any tree-sitter supported language by searching for method_invocation / call_expression nodes whose text contains the pattern.
Used by auto_diagnose to give the model a complete list of similar call sites when a stack trace points to one — preventing the “fix one, miss nine” pattern.
Auto Trait Implementations§
impl Freeze for SemanticSearcher
impl RefUnwindSafe for SemanticSearcher
impl Send for SemanticSearcher
impl Sync for SemanticSearcher
impl Unpin for SemanticSearcher
impl UnsafeUnpin for SemanticSearcher
impl UnwindSafe for SemanticSearcher
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 more