Skip to main content

print_class_method

Function print_class_method 

Source
pub fn print_class_method(method: &TsClassMethod, depth: usize) -> String
Expand description

Print a single TsClassMethod on its own, at depth — the class-method sibling of print_object_entry’s own “one fragment, not a whole document” entry point. depth means the class’s own depth (matching print_object_entry’s own convention exactly), so the method itself lands at depth + 1, its own body at depth + 2. #1359’s own real need: emit_provider’s own class wrapper stays hand-written text (each method’s own body needs a per-method source-map sub-builder/ merge, and the wrapper’s own real spacing — no blank line between methods — genuinely differs from TsDecl::Class’s own “one blank line before each method” policy, events_fanout.rs’s real convention, #1317), so each real method prints through here directly into that still-hand-written wrapper. Deliberately no automatic blank-line insertion of its own — the same “caller controls spacing” contract print_object_entry already established.