Skip to main content

file_representatives

Function file_representatives 

Source
pub fn file_representatives(
    fragments: &[Fragment],
) -> FxHashMap<String, FragmentId>
Expand description

One representative fragment per file — the largest by token count, ties resolved by first-seen order. This is the semantics SiblingEdgeBuilder always used for its file-level edges; file-level relations (an include, a header/impl pair, a path reference) link representatives rather than every-fragment-to-every-fragment, because the relation names the file. A change endorsing a file diffusely must not outweigh a call edge naming one symbol — the fragment-pair encoding gave both the same weight, which is simultaneously the quadratic edge blow-up (envoy: 22M c-family edges) and the file-level noise mechanism of #65. Reachability of the file’s other fragments is the containment star’s job.