Expand description
Potentially fatal diagnostics and diagnostic handling for compilers.
§Usage
See the examples directory for some examples of how to use this crate.
§Relationship to Other Crates
This crate can be thought of as a high-level wrapper around the ariadne crate, as its core functionality is driven by it. It is also kind of a spiritual successor to the rich-err crate I wrote, but to be honest, I totally forgot that existed until I went to publish this one.
There is also the ariadnenum crate, which fulfills a similar purpose to the maybe-fatal-derive crate in this repository. The primary difference is that maybe-fatal-derive was designed specifically for use in the context of this crate, whereas ariadnenum is meant for a workflow that is already using ariadne directly.
One other crate worth mentioning is wurm, which was similarly made for non-fatal error
handling. I considered using that crate here, but it made more sense with how I had designed the
Diagnostic type to just make my own stuff. Functionality relating to that can be found in
the sink module.
§Prerelease Status
This is currently marked as being in beta, as I am still working on making sure the API is as ergonomic and flexible as possible. I would also like to add some more detailed documentation, unit tests, integration tests, and examples.
Modules§
- additional_
attributes - Additional Attributes
- code
- Diagnostic codes.
- prelude
- sink
- Types that can act as “sinks” for
ClassifiedDiagnostics. - traits
- Various traits for working with
Diagnostics.
Structs§
- Classified
Diagnostic - A
Diagnosticwith an explicit severity. - Color
Palette - A selection of colors to use when building diagnostics.
- Config
- A type used to configure a report
- Diagnostic
- A contextualized message meant to assist the user in diagnosing and resolving issues.
- Label
- A type that represents a labelled section of source code.
Enums§
- Context
- Some contextual information about a diagnostic.
- Diagnostic
Severity - The severity of a
Diagnostic.
Derive Macros§
- Diagnose
derive - Implements
Diagnosefor astructwith a span and an info field. - Diagnostic
Group derive - Implements
DiagnosticGroupfor anenum. - Diagnostic
Info Wrapper derive - Implements
DiagnosticGroupandPartialDiagnosefor anenumwith newtype variants that also implementDiagnosticGroupandPartialDiagnose. - Partial
Diagnose derive - Implements
PartialDiagnosefor astructor anenumwithstructvariants.