zesterer / ariadne

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

Colored Spans #97

Closed BrettMayson closed 5 months ago

BrettMayson commented 6 months ago

Adds colored spans that take priority over labels. Useful for showing correlation with suggestions / help text. Implements my issue in #96

image

Without the PR, using empty labels that result in a bunch of whitespace.

image

zesterer commented 6 months ago

I wonder whether labels without a message should just default to this behaviour? That would seem sensible to me. What do you think?

BrettMayson commented 6 months ago

I thought of that at first, but went this way because I like the intentionality behind it, but if you think empty labels would be better I am happy to rework this PR

zesterer commented 6 months ago

I think that's probably preferable over adding another corner of the API. I highly doubt that "empty label that occupies space for no reason" is a desirable thing, so we might as well use that case for this.

zesterer commented 5 months ago

Oh... why was this closed?

BrettMayson commented 5 months ago

Doing this via labels was going to need more work than I want to put into it right now, and I am no longer using ariadne in my project