Skip to main content

RubySource

Trait RubySource 

Source
pub trait RubySource:
    CodeUnitIndex
    + TypeHierarchyProvider
    + ImportAnalysisProvider {
    // Required methods
    fn all_files(&self) -> Vec<ProjectFile>;
    fn autoload_constant_files(&self) -> &HashMap<String, HashSet<ProjectFile>>;
    fn has_zeitwerk_autoload_conventions(&self) -> bool;
    fn zeitwerk_autoload_files(&self) -> &HashSet<ProjectFile>;
    fn zeitwerk_consumer_files(&self) -> &HashSet<ProjectFile>;
    fn zeitwerk_autoload_code_units(&self) -> &HashSet<CodeUnit>;
    fn reverse_import_index(
        &self,
    ) -> Arc<HashMap<ProjectFile, Arc<HashSet<ProjectFile>>>> ;
    fn mixin_relations(&self) -> &[TypeRelation];
    fn semantic_facts(&self) -> &RubySemanticFacts;
    fn types_by_identifier(&self) -> &HashMap<String, Vec<CodeUnit>>;
    fn method_dispatch_mode(&self, unit: &CodeUnit) -> RubyMethodDispatchMode;
    fn forward_owner_relation_facts(
        &self,
        owner: &CodeUnit,
    ) -> Vec<RubyOwnerRelationFact>;
}

Required Methods§

Source

fn all_files(&self) -> Vec<ProjectFile>

The analyzed live file set (TreeSitterAnalyzer::all_files).

Source

fn autoload_constant_files(&self) -> &HashMap<String, HashSet<ProjectFile>>

Workspace-wide autoload :Const, "path" edges, keyed by the $-joined constant name. Built by crate::imports::build_autoload_constant_files.

Source

fn has_zeitwerk_autoload_conventions(&self) -> bool

Whether Gemfile/Gemfile.lock declare rails or zeitwerk. Built by crate::imports::detect_zeitwerk_autoload_conventions.

Source

fn zeitwerk_autoload_files(&self) -> &HashSet<ProjectFile>

Source

fn zeitwerk_consumer_files(&self) -> &HashSet<ProjectFile>

Source

fn zeitwerk_autoload_code_units(&self) -> &HashSet<CodeUnit>

Source

fn reverse_import_index( &self, ) -> Arc<HashMap<ProjectFile, Arc<HashSet<ProjectFile>>>>

required_files inverted over the whole workspace, memoized through the analyzer’s PoolSafeMemo.

Source

fn mixin_relations(&self) -> &[TypeRelation]

The resolved include/prepend/extend graph. Built by crate::mixins::ruby_collect_mixin_relations.

Source

fn semantic_facts(&self) -> &RubySemanticFacts

Source

fn types_by_identifier(&self) -> &HashMap<String, Vec<CodeUnit>>

Class/module declarations indexed by trailing identifier. Built by crate::hierarchy::build_ruby_types_by_identifier.

Source

fn method_dispatch_mode(&self, unit: &CodeUnit) -> RubyMethodDispatchMode

The persisted per-method dispatch mode, defaulting to Instance.

Source

fn forward_owner_relation_facts( &self, owner: &CodeUnit, ) -> Vec<RubyOwnerRelationFact>

The decoded superclass and mixin relations declared by owner, read out of the analyzer’s persisted per-file state. See this module’s note.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§