-
Notifications
You must be signed in to change notification settings - Fork 889
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use annotate-snippets for emitting errors #3507
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution ! Can you add few docs about the new functions you added ?
Regarding fancy_print
I believe its targeted use was within the crate. If used as a library, I think one would rely on the report struct, not on its pretty output (unless for debugging).
However, given we reached 1.0, we should strive for not breaking public API. @topecongiro what do you think ? What about marking that method as deprecated ?
@scampi
and this includes changes to the public API to rustfmt as a library. Hence, removing fancy_print and the Display impl from FormatReport is a breaking change and requires a major version update. |
@bash This looks great, thank you! I really like the change you brought with this PR, so using them internally is perfectly fine. But for the reason I noted in the above comment, could you put back the removed |
@topecongiro thanks for pointing this out |
Co-Authored-By: bash <ruben.schmidmeister@icloud.com>
@scampi |
@topecongiro |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Are you OK with the changes @topecongiro ?
Awesome, thank you! |
Resolves #2729.
There are a couple of things that I'm not sure if I did them correctly:
annotate-snippets
doesn't have an "internal error" annotation type. I'm currently printing "internal" as the annotation id (where the error id usually is inrustc
):rustfmt
have any guarantees about the public API when used as a library? Because I removedfancy_print
and theDisplay
impl fromFormatReport
both of which werepub
.