Skip to main content

format_module_diagnostic

Function format_module_diagnostic 

Source
pub fn format_module_diagnostic(
    error: &ModuleDiagnostic,
    renderer: &Renderer,
) -> String
Expand description

Formats a module diagnostic against its retained source owners.

Native labels remain visible without invented locations.

  • Complexity: O(n + l) source and label bytes, excluding snippet rendering.

ยงExamples

let error = adam_lang::ModuleDiagnostic {
    message: "missing root".into(), labels: vec![], cause: None,
};
assert_eq!(adam_web_ui::format_module_diagnostic(&error,
    &adam_web_ui::Renderer::plain()), "missing root");