Skip to main content

render_diagnostic

Function render_diagnostic 

Source
pub fn render_diagnostic(
    diag: &ResolvedDiagnostic,
    opts: &OutputOptions,
) -> String
Expand description

Render a ResolvedDiagnostic to a String. The returned string ends with a newline. Produces:

  • file:line:col: kind: message\n
  • the source line + \n (if available)
  • the caret/underline line + \n (only for all-ASCII source lines)

Port of printDiagnosticHelper.