Skip to main content

WorkspaceIndex

Struct WorkspaceIndex 

Source
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

Source

pub fn new() -> Self

Source

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.

Source

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.

Source

pub fn remove_file(&self, uri: &str)

Remove all entries for a file.

Source

pub fn find_definitions(&self, kind: SymbolKind, name: &str) -> Vec<Arc<Symbol>>

Find definitions by kind and name (case-insensitive).

Source

pub fn find_by_name(&self, name: &str) -> Vec<Arc<Symbol>>

Find any definition matching a name (case-insensitive), regardless of kind.

Source

pub fn resolve(&self, name: &QualifiedName) -> Vec<Arc<Symbol>>

Find definitions matching a qualified name (with schema resolution).

Source

pub fn find_references(&self, name: &str) -> Vec<Arc<SymbolRef>>

Find all references to a name across the workspace.

Source

pub fn file_symbols(&self, uri: &str) -> Vec<Arc<Symbol>>

Get all definitions in a specific file.

Source

pub fn all_symbols(&self) -> Vec<Arc<Symbol>>

Get all definitions across the workspace.

Source

pub fn search(&self, query: &str) -> Vec<Arc<Symbol>>

Search for symbols matching a query string (for workspace/symbol).

Trait Implementations§

Source§

impl Default for WorkspaceIndex

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.