pub struct AnnotationDiscovery { /* private fields */ }Expand description
Discovers annotations from program AST and imports
Implementations§
Source§impl AnnotationDiscovery
impl AnnotationDiscovery
Sourcepub fn discover_from_program(&mut self, program: &Program)
pub fn discover_from_program(&mut self, program: &Program)
Discover annotations from a parsed program
Sourcepub fn discover_from_imports_with_cache(
&mut self,
program: &Program,
current_file: &Path,
module_cache: &ModuleCache,
workspace_root: Option<&Path>,
)
pub fn discover_from_imports_with_cache( &mut self, program: &Program, current_file: &Path, module_cache: &ModuleCache, workspace_root: Option<&Path>, )
Discover annotations from imported modules using module cache
Looks at import statements in the program and loads the corresponding modules to discover their exported annotations.
NOTE: Annotations are now fully defined in Shape stdlib, not hardcoded in Rust. The LSP discovers annotations from:
- Local
annotation ... { ... }definitions in the current file - Imported modules (including stdlib/core/annotations/, stdlib/finance/, etc.)
Sourcepub fn discover_from_imports(&mut self, _program: &Program)
pub fn discover_from_imports(&mut self, _program: &Program)
Discover annotations from imported modules (simple version without module cache)
NOTE: Without module cache, no annotations are discovered. Use discover_from_imports_with_cache() for full annotation discovery.
Sourcepub fn all_annotations(&self) -> Vec<&AnnotationInfo>
pub fn all_annotations(&self) -> Vec<&AnnotationInfo>
Get all discovered annotations
Sourcepub fn is_defined(&self, name: &str) -> bool
pub fn is_defined(&self, name: &str) -> bool
Check if an annotation is defined
Sourcepub fn get(&self, name: &str) -> Option<&AnnotationInfo>
pub fn get(&self, name: &str) -> Option<&AnnotationInfo>
Get information about a specific annotation
Trait Implementations§
Source§impl Clone for AnnotationDiscovery
impl Clone for AnnotationDiscovery
Source§fn clone(&self) -> AnnotationDiscovery
fn clone(&self) -> AnnotationDiscovery
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 AnnotationDiscovery
impl Debug for AnnotationDiscovery
Source§impl Default for AnnotationDiscovery
impl Default for AnnotationDiscovery
Source§fn default() -> AnnotationDiscovery
fn default() -> AnnotationDiscovery
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AnnotationDiscovery
impl RefUnwindSafe for AnnotationDiscovery
impl Send for AnnotationDiscovery
impl Sync for AnnotationDiscovery
impl Unpin for AnnotationDiscovery
impl UnsafeUnpin for AnnotationDiscovery
impl UnwindSafe for AnnotationDiscovery
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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