pub struct SemanticIndex { /* private fields */ }Expand description
Semantic index for code symbols
Implementations§
Source§impl SemanticIndex
impl SemanticIndex
Sourcepub fn add_symbol(&mut self, symbol: Symbol)
pub fn add_symbol(&mut self, symbol: Symbol)
Add a symbol to the index
Sourcepub fn add_reference(&mut self, reference: SymbolReference)
pub fn add_reference(&mut self, reference: SymbolReference)
Add a reference to the index
Sourcepub fn get_symbol(&self, symbol_id: &str) -> Option<&Symbol>
pub fn get_symbol(&self, symbol_id: &str) -> Option<&Symbol>
Get a symbol by ID
Sourcepub fn get_symbols_by_name(&self, name: &str) -> Vec<&Symbol>
pub fn get_symbols_by_name(&self, name: &str) -> Vec<&Symbol>
Get all symbols with a given name
Sourcepub fn get_symbols_in_file(&self, file: &PathBuf) -> Vec<&Symbol>
pub fn get_symbols_in_file(&self, file: &PathBuf) -> Vec<&Symbol>
Get all symbols in a file
Sourcepub fn get_references_to_symbol(&self, symbol_id: &str) -> Vec<&SymbolReference>
pub fn get_references_to_symbol(&self, symbol_id: &str) -> Vec<&SymbolReference>
Get all references to a symbol
Sourcepub fn search_by_name(&self, query: &str) -> Vec<SearchResult>
pub fn search_by_name(&self, query: &str) -> Vec<SearchResult>
Search for symbols by name (substring match)
Sourcepub fn search_by_kind(&self, kind: SymbolKind) -> Vec<&Symbol>
pub fn search_by_kind(&self, kind: SymbolKind) -> Vec<&Symbol>
Search for symbols by kind
Sourcepub fn all_symbols(&self) -> Vec<&Symbol>
pub fn all_symbols(&self) -> Vec<&Symbol>
Get all symbols in the index
Sourcepub fn symbol_count(&self) -> usize
pub fn symbol_count(&self) -> usize
Get the total number of symbols
Sourcepub fn reference_count(&self) -> usize
pub fn reference_count(&self) -> usize
Get the total number of references
Trait Implementations§
Source§impl Clone for SemanticIndex
impl Clone for SemanticIndex
Source§fn clone(&self) -> SemanticIndex
fn clone(&self) -> SemanticIndex
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SemanticIndex
impl Debug for SemanticIndex
Auto Trait Implementations§
impl Freeze for SemanticIndex
impl RefUnwindSafe for SemanticIndex
impl Send for SemanticIndex
impl Sync for SemanticIndex
impl Unpin for SemanticIndex
impl UnwindSafe for SemanticIndex
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