Skip to main content

render_diagnostic

Function render_diagnostic 

Source
pub fn render_diagnostic(
    source: &str,
    filename: &str,
    span: &Span,
    severity: &str,
    message: &str,
    label: Option<&str>,
    help: Option<&str>,
) -> String
Expand description

Render a Rust-style diagnostic message.

Example output:

error: undefined variable `x`
  --> example.harn:5:12
   |
 5 |     let y = x + 1
   |             ^ not found in this scope