Skip to main content

print_multi_source

Function print_multi_source 

Source
pub fn print_multi_source(
    program: &TsProgram,
    map: SourceMapBuilder,
    output_file: &str,
) -> Printed
Expand description

#1486’s own multi-source sibling of print(): a test/integration module’s own aggregate map spans one source per fragment file a case’s body was spliced in from (emit_test_module/emit_integration_module, project/tests_emit.rs), not the single .bynk file print’s own signature assumes — see TsStmt::nested_map_source_id’s own doc for why a per-statement source selector needs a caller that can register more than one source in the first place. Takes the caller’s own already- built map directly (rather than a (name, text) list built fresh here) so a caller can keep registering sources incrementally as it discovers them — emit_test_module’s own per-case loop, one add_source call per case, exactly as it already did before this function existed — and get each call’s own returned id back immediately, to set on that case’s own top-level statement’s nested_map_source_id, instead of having to pre-compute the full source list up front. Every statement’s own nested_map_source_id selects which of map’s already-registered sources (by id) its own nested_map merges against; a statement with no span of its own (this whole module’s own shape — an aggregate with no single “primary” source of its own) never records a top-level checkpoint, so map’s own id-0 source (if any) needs no special “primary” meaning here the way print()’s single source does.