pub struct SearchModule { /* private fields */ }Expand description
Search module for semantic code queries.
Implementations§
Source§impl SearchModule
impl SearchModule
Sourcepub fn new(store: Arc<UnifiedGraphStore>) -> Self
pub fn new(store: Arc<UnifiedGraphStore>) -> Self
Create a new SearchModule.
Sourcepub async fn index(&self) -> ForgeResult<()>
pub async fn index(&self) -> ForgeResult<()>
Indexes the codebase for search.
llmgrep reads magellan’s DB directly, so this is a no-op.
The graph module’s index() populates the shared DB.
Sourcepub async fn pattern_search(&self, pattern: &str) -> ForgeResult<Vec<Symbol>>
pub async fn pattern_search(&self, pattern: &str) -> ForgeResult<Vec<Symbol>>
Pattern-based search using regex.
With llmgrep: delegates to llmgrep::forge::search_symbols_regex.
Without: scans source files recursively with regex.
Sourcepub async fn pattern(&self, pattern: &str) -> ForgeResult<Vec<Symbol>>
pub async fn pattern(&self, pattern: &str) -> ForgeResult<Vec<Symbol>>
Pattern-based search (alias for pattern_search).
Sourcepub async fn semantic_search(&self, query: &str) -> ForgeResult<Vec<Symbol>>
pub async fn semantic_search(&self, query: &str) -> ForgeResult<Vec<Symbol>>
Semantic search using natural language.
With llmgrep: delegates to llmgrep::forge::search_symbols.
Without: splits query into keywords and scans files.
Sourcepub async fn semantic(&self, query: &str) -> ForgeResult<Vec<Symbol>>
pub async fn semantic(&self, query: &str) -> ForgeResult<Vec<Symbol>>
Semantic search (alias for semantic_search).
Sourcepub async fn symbol_by_name(&self, name: &str) -> ForgeResult<Option<Symbol>>
pub async fn symbol_by_name(&self, name: &str) -> ForgeResult<Option<Symbol>>
Find a specific symbol by name.
Sourcepub async fn symbols_by_kind(
&self,
kind: SymbolKind,
) -> ForgeResult<Vec<Symbol>>
pub async fn symbols_by_kind( &self, kind: SymbolKind, ) -> ForgeResult<Vec<Symbol>>
Find all symbols of a specific kind.
Sourcepub async fn references(
&self,
symbol_name: &str,
limit: usize,
) -> ForgeResult<Vec<Symbol>>
pub async fn references( &self, symbol_name: &str, limit: usize, ) -> ForgeResult<Vec<Symbol>>
Find all references to a symbol.
Auto Trait Implementations§
impl Freeze for SearchModule
impl RefUnwindSafe for SearchModule
impl Send for SearchModule
impl Sync for SearchModule
impl Unpin for SearchModule
impl UnsafeUnpin for SearchModule
impl UnwindSafe for SearchModule
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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