Skip to content

Diagnostic

A compiler diagnostic produced by compile.

Fields

severity

The diagnostic severity as a symbol:

  • :ERROR:
  • :WARNING:

message

The primary diagnostic message as Str.

span

The primary source Span for the diagnostic.

annotations

An array of Annotation objects describing additional highlighted source regions.

notes

An array of Note objects with extra context or help.

patches

An array of Patch objects describing suggested edits.

Methods

render

Renders the diagnostic for terminal presentation. The rendered value does not include a final newline.

Returns: term.Text

Example

let result = compile "bad.dol" "let =\n"
for diag = result.diagnostics
  echo $diag.render()