Skip to main content

infer_modules

Function infer_modules 

Source
pub fn infer_modules(
    file_imports: &[(String, String)],
    all_files: &[String],
) -> Vec<Module>
Expand description

Infer modules from file-level import edges.

Algorithm:

  1. Exclusive-dependency merge: if file B has fan-in=1 (only imported by A), merge B into A’s module. Repeat until no new merges.
  2. Directory fallback: remaining unmerged files are grouped by parent directory.