pub struct WorkspaceIndex { /* private fields */ }Implementations§
Source§impl WorkspaceIndex
impl WorkspaceIndex
pub fn new() -> Self
Sourcepub fn scan_folder(&self, root: &Path)
pub fn scan_folder(&self, root: &Path)
Analyze every LOGOS file under root (bounded). Blocking — run it on
a blocking task.
Sourcepub fn index_file(&self, path: &Path)
pub fn index_file(&self, path: &Path)
(Re-)analyze one file into the index.
pub fn remove(&self, uri: &Url)
Sourcepub fn module_exporting(&self, name: &str) -> Vec<ModuleExport>
pub fn module_exporting(&self, name: &str) -> Vec<ModuleExport>
Every module that publicly exports name (a function/type/variant).
Sourcepub fn imports_of(&self, uri: &Url) -> Vec<String>
pub fn imports_of(&self, uri: &Url) -> Vec<String>
The module aliases the file at uri imports.
Sourcepub fn imported_symbols(&self, uri: &Url) -> Vec<(String, String)>
pub fn imported_symbols(&self, uri: &Url) -> Vec<(String, String)>
The exact symbol labels to complete for this file’s imports, paired with
the module they come from. A SELECTIVE Import double from Util. offers
only double (or its as alias); a whole-module Import Util. offers
every public export of Util — so completion never suggests a name the
import didn’t actually bring into scope.
Sourcepub fn exports_of(&self, uri: &Url) -> Vec<String>
pub fn exports_of(&self, uri: &Url) -> Vec<String>
The public names the module at uri exports (function/type/variant).
Sourcepub fn module_names(&self) -> Vec<(String, Url)>
pub fn module_names(&self) -> Vec<(String, Url)>
Every indexed module: its import alias and file Url.
Sourcepub fn references_of(&self, name: &str, skip: &[&Url]) -> Vec<Location>
pub fn references_of(&self, name: &str, skip: &[&Url]) -> Vec<Location>
Every cross-file occurrence of name outside skip (the URIs whose
LIVE buffers answer for themselves). A file’s occurrence counts when
its own scope did NOT resolve it (so it reaches across files), or when
the file itself defines the symbol (its local uses ARE the symbol).
Sourcepub fn query(&self, needle: &str, limit: usize) -> Vec<WorkspaceSymbol>
pub fn query(&self, needle: &str, limit: usize) -> Vec<WorkspaceSymbol>
Case-insensitive substring query across the workspace.
Sourcepub fn definition_of(&self, name: &str) -> Option<Location>
pub fn definition_of(&self, name: &str) -> Option<Location>
The definition location for an exact name, for cross-file goto-def. Callable (function) and type-like definitions win over incidental name matches in other kinds.
Trait Implementations§
Source§impl Default for WorkspaceIndex
impl Default for WorkspaceIndex
Source§fn default() -> WorkspaceIndex
fn default() -> WorkspaceIndex
Source§impl WorkspaceView for WorkspaceIndex
impl WorkspaceView for WorkspaceIndex
Source§fn module_exporting(&self, name: &str) -> Vec<ModuleExport>
fn module_exporting(&self, name: &str) -> Vec<ModuleExport>
name (a function/type/variant).Source§fn module_names(&self) -> Vec<(String, Url)>
fn module_names(&self) -> Vec<(String, Url)>
Source§fn exports_of(&self, uri: &Url) -> Vec<String>
fn exports_of(&self, uri: &Url) -> Vec<String>
uri exports. Default empty (fakes that
don’t need it are unaffected).Source§fn imported_symbols(&self, uri: &Url) -> Vec<(String, String)>
fn imported_symbols(&self, uri: &Url) -> Vec<(String, String)>
imports_of/exports_of keeps its behavior.
The real index overrides this to honor selective imports.Auto Trait Implementations§
impl Freeze for WorkspaceIndex
impl !RefUnwindSafe for WorkspaceIndex
impl Send for WorkspaceIndex
impl Sync for WorkspaceIndex
impl Unpin for WorkspaceIndex
impl UnsafeUnpin for WorkspaceIndex
impl UnwindSafe for WorkspaceIndex
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.