Skip to main content

extract_target_statement

Function extract_target_statement 

Source
pub fn extract_target_statement(
    content: &str,
    lang_name: &str,
    target_line: u32,
    target_col: Option<u32>,
) -> Option<String>
Expand description

Extract a compact, context-aware statement snippet around the target position.

  • Preserves formatting/newlines (not whitespace-collapsed).
  • Strips leading Rust attributes on the statement.
  • Aggressively elides long block interiors with a placeholder to keep cards compact.