Skip to main content

print_class_method_and_merge

Function print_class_method_and_merge 

Source
pub fn print_class_method_and_merge(
    out: &mut String,
    method: &TsClassMethod,
    depth: usize,
    map: &mut SourceMapBuilder,
    source_id: usize,
)
Expand description

print_class_method’s own sibling (#1477): identical rendering, but merges any of method.body’s own direct-child nested_maps into map as they print, at the real print-time offset — no reverse-engineering the offset from the returned text afterward, the way bynk-emit’s own emit_class_method_and_merge_source_map (emitter/emit.rs) has to today. Kept as a separate function, not an added parameter on print_class_method itself, so every existing caller’s own call sites are untouched — this is a strict addition.

Appends to the caller’s own out, the same “must be the real buffer, not a throwaway local one” reasoning print_stmt_and_merge’s own doc explains in full. source_id: see this crate’s own private MergeTarget’s own doc.