Improve composition diagnostics
This commit is contained in:
@@ -125,14 +125,21 @@ fn normalize_path(path: &str) -> Option<String> {
|
||||
}
|
||||
|
||||
fn format_diagnostic(diagnostic: decodal_core::Diagnostic) -> String {
|
||||
format!(
|
||||
let mut out = format!(
|
||||
"{:?} at {}:{}..{}: {}",
|
||||
diagnostic.kind,
|
||||
diagnostic.span.source.0,
|
||||
diagnostic.span.start,
|
||||
diagnostic.span.end,
|
||||
diagnostic.message,
|
||||
)
|
||||
);
|
||||
for label in diagnostic.labels {
|
||||
out.push_str(&format!(
|
||||
"\nnote at {}:{}..{}: {}",
|
||||
label.span.source.0, label.span.start, label.span.end, label.message,
|
||||
));
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
fn format_data(data: &Data, indent: usize) -> String {
|
||||
|
||||
Reference in New Issue
Block a user