Improve composition diagnostics

This commit is contained in:
2026-06-22 17:37:51 +09:00
parent 8b3df21cfa
commit cc5ab63922
10 changed files with 518 additions and 175 deletions
+9 -2
View File
@@ -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 {