pub fn format_diagnostic_json(diagnostic: &Diagnostic) -> Option<String>Expand description
Serialize a Diagnostic to a single-line JSON string. Tagged
discriminated union (#[serde(tag = "type")]) keeps the shape
stable across versions. Returns None only on JSON serialization
failure, which should never happen for the variants we own.