Skip to main content

extract_code_snip

Function extract_code_snip 

Source
pub fn extract_code_snip(
    source: &str,
    line_number: u32,
    context_lines: u32,
) -> String
Expand description

Extract a code snippet from source text centered around a line number.

Returns a string with line-number-prefixed source lines, matching the Konveyor output format.