zesterer / ariadne

A fancy diagnostics & error reporting crate
https://crates.io/crates/ariadne
MIT License
1.74k stars 77 forks source link

Multiple messages/notes #5

Open eaglgenes101 opened 3 years ago

eaglgenes101 commented 3 years ago

In codespan-reporting crate, it is possible to attach multiple notes to a diagnostic message. In ariadne, there is only one message and only one note available to provide, limiting the diagnostic messages that I can create with an Ariadne report. It'd be a nice feature if I could associate multiple formatted messages or notes to any given Ariadne report.

zesterer commented 3 years ago

How do you imagine these being displayed in the diagnostic? Just a list of notes below the diagnostic like below?

    | Note: This is a note
    | Note: This is another note
    | Note: This is the third note
eaglgenes101 commented 3 years ago

Yeah, probably.

zesterer commented 3 years ago

Unfortunately I'm away for the next 10 days, but I can implement this when I get back.

indietyp commented 1 year ago

I am currently trying to use ariadne, where I have a specific usecase where this would be very helpful.

What is the current status? Is there anything I can do to help with this?

zesterer commented 1 year ago

If you're interested in implementing this, it wouldn't be too difficult! The crux of it would be to switch this Option to a Vec and then turn its usage location in write.rs from an if let into a for _ in. Whatever you build on top of that is up to you of course :)