You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the related errors of a given report will show just one after another, without any clear indication of them belonging tightly to the outer error.
I.e., in my project, right now I have errors like these:
Which are supposed to express that the two related errors are actually part of the outer error -- clearly not quite the intended use for related.
I can get closer to a more intuitive visualization by storing the related errors in a simple struct ErrList(#[related] Vec<Report>):
However, this now requires me to have another error message be displayed, which often doesn't add any semantic value, and takes up a lot of space.
For cases like these, where I really want to show several siblings as nested within one outer error, I'd optimally want to have them be displayed roughly like this:
My proposal here would be to add a variant of "related" errors that explicitly declare them as nested, i.e.:
Nice! I'd love to take a stab at this, but I'm a bit unsure on how to approach an implementation here:
If the idea is to actually have this as a property of the related attribute, then I don't know how to express that within the current structure of the Diagnostic trait.
Alternatively, I could just add a separate nested field to the Diagnostic trait, which would potentially feel cleaner, but is also a much larger change to the API.
A third, minimally invasive, approach would be to just make the way related errors are shown a global setting in the GraphicalReportHandler.
What do you think, @zkat? Or is there something else I'm missing?
Probably a configuration in the GraphicalReportHandler is probably best, esp since this is all about controlling how things look, rather than some fundamental property about the relationship between diagnostics
Currently, the
related
errors of a given report will show just one after another, without any clear indication of them belonging tightly to the outer error.I.e., in my project, right now I have errors like these:
Which are supposed to express that the two related errors are actually part of the outer error -- clearly not quite the intended use for
related
.I can get closer to a more intuitive visualization by storing the related errors in a simple
struct ErrList(#[related] Vec<Report>)
:However, this now requires me to have another error message be displayed, which often doesn't add any semantic value, and takes up a lot of space.
For cases like these, where I really want to show several siblings as nested within one outer error, I'd optimally want to have them be displayed roughly like this:
My proposal here would be to add a variant of "related" errors that explicitly declare them as nested, i.e.:
The text was updated successfully, but these errors were encountered: