An error or warning reported by Typst.
:severity-:erroror:warning.:message- what the problem is.:file- the file the problem is in. For a problem in the template itself, it's the template's file (the module's.exfile for the~TYPSTsigil, or its.typfile), ornilfor a template rendered from a string. For a problem in a component (seeTypsty.Component), it's the component's file, in the same way. For other files, it's their path in the project (/styles.typ), or@namespace/name:version/pathfor a file in a package.:lineand:column- where the problem is, both starting at 1, ornilwhen it has no location. For the template itself and for components, they point into their file: the line of a~TYPSTsigil in the module, for example.:hints- suggestions from Typst to fix the problem.:trace- for a problem in a function or a file called from elsewhere, the calls that led to it, as maps with the:message,:file,:lineand:columnkeys.
Summary
Functions
Formats the diagnostic as a message, like lib/invoice.ex:12:5: unknown variable: total,
followed by its hints and trace.
Types
@type t() :: %Typsty.Diagnostic{ column: pos_integer() | nil, file: String.t() | nil, hints: [String.t()], line: pos_integer() | nil, message: String.t(), severity: :error | :warning, trace: [trace_point()] }
@type trace_point() :: %{ message: String.t(), file: String.t() | nil, line: pos_integer() | nil, column: pos_integer() | nil }