Skip to main content

unknown_key_diagnostic

Function unknown_key_diagnostic 

Source
pub(crate) fn unknown_key_diagnostic(
    message: String,
    key: &str,
    key_span: &SourceSpan,
    candidates: &[&str],
) -> Diagnostic
Expand description

Build the MOS0015 unknown-keyword-argument diagnostic shared by #set, #image, #figure, and #bibliography, attaching a fix replacing exactly the key token when one known key is a conservative near-miss.

key_span must cover exactly the identifier token, so the suggestion is machine-applicable without touching surrounding syntax.