pub struct TypeHierarchyProvider;Expand description
Provider for type hierarchy (inheritance) information
Implementations§
Source§impl TypeHierarchyProvider
impl TypeHierarchyProvider
Sourcepub fn new() -> TypeHierarchyProvider
pub fn new() -> TypeHierarchyProvider
Creates a new type hierarchy provider
Sourcepub fn prepare(
&self,
ast: &Node,
code: &str,
offset: usize,
) -> Option<Vec<TypeHierarchyItem>>
pub fn prepare( &self, ast: &Node, code: &str, offset: usize, ) -> Option<Vec<TypeHierarchyItem>>
Prepare type hierarchy at position
Sourcepub fn find_supertypes(
&self,
ast: &Node,
item: &TypeHierarchyItem,
) -> Vec<TypeHierarchyItem>
pub fn find_supertypes( &self, ast: &Node, item: &TypeHierarchyItem, ) -> Vec<TypeHierarchyItem>
Find supertypes (parent classes and composed roles)
Sourcepub fn c3_mro(&self, ast: &Node, package: &str) -> Vec<String>
pub fn c3_mro(&self, ast: &Node, package: &str) -> Vec<String>
Compute the C3 Method Resolution Order (MRO) for a package.
Returns a linearized list starting with package itself, followed by
ancestors in the order Perl’s C3 MRO would search them. Each class
appears exactly once. If the C3 merge is inconsistent the algorithm
falls back to a depth-first left-to-right order with deduplication.
Sourcepub fn find_subtypes(
&self,
ast: &Node,
item: &TypeHierarchyItem,
) -> Vec<TypeHierarchyItem>
pub fn find_subtypes( &self, ast: &Node, item: &TypeHierarchyItem, ) -> Vec<TypeHierarchyItem>
Find subtypes (child classes) that inherit from this class
Trait Implementations§
Source§impl Default for TypeHierarchyProvider
impl Default for TypeHierarchyProvider
Source§fn default() -> TypeHierarchyProvider
fn default() -> TypeHierarchyProvider
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TypeHierarchyProvider
impl RefUnwindSafe for TypeHierarchyProvider
impl Send for TypeHierarchyProvider
impl Sync for TypeHierarchyProvider
impl Unpin for TypeHierarchyProvider
impl UnsafeUnpin for TypeHierarchyProvider
impl UnwindSafe for TypeHierarchyProvider
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