Skip to main content

Module diagnostic

Module diagnostic 

Source
Expand description

The canonical machine-readable diagnostic surface: logos-diagnostic/1.

One Diagnostic JSON shape, produced here and consumed identically by largo check --json, largo run --json, the MCP server, and (for code and severity identity) the language server. Every ParseErrorKind variant decides its stable kebab-case code, its severity, and a one-line headline in wildcard-free matches — a new error kind does not compile until it has all three.

The catalog enumerates one rendered sample per variant and is the single source for the generated error catalog and largo explain.

Structs§

CatalogEntry
One rendered sample per ParseErrorKind variant — the source of the generated error catalog and largo explain <code>.
DiagSpan
A source span in both byte offsets and 1-based, char-counted line/column.
Diagnostic
One logos-diagnostic/1 object.
RelatedInfo
A secondary location attached to a diagnostic.

Enums§

DiagSeverity
How severely a diagnostic should be presented.

Functions§

catalog
The full rendered catalog, one entry per variant.
catalog_json
The catalog as errors.json (schema logos-errors/1): one object per variant, pretty-printed, newline-terminated.
catalog_markdown
The catalog as the reference guide docs/ERROR_CATALOG.md: one section per code (variants sharing a code share a section), each sample headline fenced as text, never as logos.
diagnostic_for
Render one parse error into the canonical logos-diagnostic/1 shape.
guide_url
The quickguide URL for an anchor — same rendering the LSP ships in codeDescription.
line_col
1-based (line, column) for a byte offset; columns count characters.
sample_kinds
One representative (variant name, kind) per ParseErrorKind variant.