Skip to content

Support reports with no source labels #134

@Nyrox

Description

@Nyrox

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions