Skip to main content

sort_functions_in_crate

Function sort_functions_in_crate 

Source
pub fn sort_functions_in_crate(
    crate_name: &str,
    nodes: &RecordBatch,
    edges: &RecordBatch,
) -> Result<Vec<String>, String>
Expand description

Topologically sort functions within a crate by call dependency order.

Filters nodes to those whose file_path is under crates/<crate_name>/, then walks Calls and Uses edges within that set (ignoring cross-crate calls). Returns node IDs (column 0 = ID) in order: callees before callers.

Pass the full workspace code_nodes and code_edges RecordBatches from crate::ingest. Returns Err on cycle detection or schema mismatch.