use ariadne::*;
const TEXT: &str = "a b c d";
fn report_n_labels(n: usize) {
let mut report = Report::build(ReportKind::Error, (), 0);
for i in 0..n {
report = report.with_label(Label::new(i * 2..i * 2 + 1));
}
report.finish().print(Source::from(TEXT)).unwrap();
}
fn main() {
for n in 1..=4 {
report_n_labels(n);
}
}
This gives output:
Error:
╭─[<unknown>:1:1]
│
1 │ a b c d
· ─
·
───╯
Error:
╭─[<unknown>:1:1]
│
1 │ a b c d
· ─ ─
·
·
·
───╯
Error:
╭─[<unknown>:1:1]
│
1 │ a b c d
· ─ ─ ─
·
·
·
·
·
───╯
Error:
╭─[<unknown>:1:1]
│
1 │ a b c d
· ─ ─ ─ ─
·
·
·
·
·
·
·
───╯
It looks like labels add extra vertical space for their messages even if they don't have messages.
This occurs with compact mode too.
I think this is undesirable.
Consider this example:
This gives output:
It looks like labels add extra vertical space for their messages even if they don't have messages. This occurs with compact mode too. I think this is undesirable.