Skip to content
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

Support reports with no source labels #134

Open
Nyrox opened this issue Dec 11, 2024 · 0 comments
Open

Support reports with no source labels #134

Nyrox opened this issue Dec 11, 2024 · 0 comments

Comments

@Nyrox
Copy link

Nyrox commented Dec 11, 2024

Right now, if I try to create a report with no source labels e.g like this

ariadne::Report::build(ReportKind::Error, 0..0)
                .with_code(3)
                .with_message("Some error occured")
                .with_note("X is causing this error")
                .with_help("Do this to fix it")
                .finish()

then ariadne renders only the message, completely omitting the note and help text.

Screenshot 2024-12-11 at 13 29 05

I have to add an empty label to get them to show up, but this is quite ugly (obviously).

Screenshot 2024-12-11 at 13 29 46

As ardiane is primarily a compiler diagnostics crate I understand you would usually have a source, but in this case I am trying to render an error for the absence of a file / property and there is no good source to relate the error to, but I still want the error to be consistently formatted with the rest of the errors.

Is there any way to print an ariadne formatted Report without a source?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant