Skip to main content

code_frame_columns

Function code_frame_columns 

Source
pub fn code_frame_columns(
    source: &str,
    start_line: u32,
    start_col: u32,
    end_line: u32,
    end_col: u32,
    message: &str,
) -> String
Expand description

Produce a code frame matching @babel/code-frame’s codeFrameColumns() in non-highlighted mode.

Columns are 0-based (matching the Rust/AST convention). They are converted to 1-based internally to match Babel’s convention (the JS caller already does column + 1).