Skip to main content

Crate espforge_diagnostics

Crate espforge_diagnostics 

Source
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:

RangeStage
E01xxsyntax (parser junk, section headers)
E02xx# espforge core and meta
E03xxoptions and their answers
E04xx$ graph resolution
E05xxperipherals
E06xxcomponents
E07xxownership and conflicts
E08xxservices 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§

DiagCode
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.