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, we support the label attribute to display the error source span. However, it seems that an error struct can have multiple labels, which sometimes results in the absence of a primary label. Therefore, I recommend adding a primary_span to indicate the primary span of the diagnostic, ensuring that the main message is clearly associated with a specific location.
I wrote about this a couple of years ago but never really made a separate issue for it: #125 (comment)
My main thought about this proposal is I'd rather reuse #[span] and just give it an optional argument to specify whether something is primary. Other than that, I think something like this is long overdue.
Currently, we support the
label
attribute to display the error source span. However, it seems that an error struct can have multiple labels, which sometimes results in the absence of a primary label. Therefore, I recommend adding a primary_span to indicate the primary span of the diagnostic, ensuring that the main message is clearly associated with a specific location.The usage should be as follows:
The text was updated successfully, but these errors were encountered: