Expand description
One diagnostic model for the whole pipeline.
A Diagnostic carries a stable code, a severity, a primary span, any
number of labels, optional help and machine-applicable fixes. The human
renderer lives here too, so the CLI prints and the library never does.
§Codes
Codes are five characters: E or W followed by four digits. The ranges
are reserved by stage so two producers cannot pick the same number:
| Range | Stage |
|---|---|
E01xx | syntax (parser junk, section headers) |
E02xx | # espforge core and meta |
E03xx | options and their answers |
E04xx | $ graph resolution |
E05xx | peripherals |
E06xx | components |
E07xx | ownership and conflicts |
E08xx | services and driver routing |
Every diagnostic carries a code from the moment it is constructed. There is no way to build one without it, and no title-to-code table.
Re-exports§
pub use render::to_human;
Modules§
- codes
- The stable diagnostic codes this slice can reach, one per message.
- render
- The human renderer: rustc-style snippets, exactly the output the CLI had before the diagnostic model moved here.
Structs§
- Diag
Code - A stable diagnostic code (
E0701). - Diagnostic
- One located problem.
- Edit
- One text replacement. Spans are byte offsets into the original source.
- Fix
- A suggested edit, shown as one action (
espforge fix, an LSP quick-fix). - Label
- One underline and its explanation.
Enums§
- Severity
- How loudly a diagnostic is reported. Only errors make a command fail.
Type Aliases§
- Diagnostics
- The whole set of problems from one stage, in render order.
- Span
- A byte range into the original source.