pub struct WorkspaceIndex { /* private fields */ }Expand description
A concurrent workspace-wide symbol index.
Stores definitions and references keyed by file URI, with lookup
by qualified name. Uses DashMap for lock-free concurrent reads.
Implementations§
Source§impl WorkspaceIndex
impl WorkspaceIndex
pub fn new() -> Self
Sourcepub fn update_file(
&self,
uri: &str,
tree: &Tree,
source: &str,
injections: &[InjectedRegion],
)
pub fn update_file( &self, uri: &str, tree: &Tree, source: &str, injections: &[InjectedRegion], )
Re-index a file: remove old entries and extract new ones from the tree.
Also extracts PL/pgSQL symbols from any injected regions.
Sourcepub fn load_symbols(&self, uri: &str, symbols: Vec<Symbol>)
pub fn load_symbols(&self, uri: &str, symbols: Vec<Symbol>)
Insert pre-built symbols (e.g., from database introspection).
Uses the provided URI to group them, allowing removal via remove_file.
Sourcepub fn remove_file(&self, uri: &str)
pub fn remove_file(&self, uri: &str)
Remove all entries for a file.
Sourcepub fn find_definitions(&self, kind: SymbolKind, name: &str) -> Vec<Arc<Symbol>>
pub fn find_definitions(&self, kind: SymbolKind, name: &str) -> Vec<Arc<Symbol>>
Find definitions by kind and name (case-insensitive).
Sourcepub fn find_by_name(&self, name: &str) -> Vec<Arc<Symbol>>
pub fn find_by_name(&self, name: &str) -> Vec<Arc<Symbol>>
Find any definition matching a name (case-insensitive), regardless of kind.
Sourcepub fn resolve(&self, name: &QualifiedName) -> Vec<Arc<Symbol>>
pub fn resolve(&self, name: &QualifiedName) -> Vec<Arc<Symbol>>
Find definitions matching a qualified name (with schema resolution).
Sourcepub fn find_references(&self, name: &str) -> Vec<Arc<SymbolRef>>
pub fn find_references(&self, name: &str) -> Vec<Arc<SymbolRef>>
Find all references to a name across the workspace.
Sourcepub fn file_symbols(&self, uri: &str) -> Vec<Arc<Symbol>>
pub fn file_symbols(&self, uri: &str) -> Vec<Arc<Symbol>>
Get all definitions in a specific file.
Sourcepub fn all_symbols(&self) -> Vec<Arc<Symbol>>
pub fn all_symbols(&self) -> Vec<Arc<Symbol>>
Get all definitions across the workspace.