A labeled span for annotating source code in diagnostics.
Labels combine a span with a message and visual priority. They are used to
highlight specific regions of source code and explain what's happening there.
Priority
Labels have two priority levels:
:primary - The main error location, highlighted prominently (typically red)
:secondary - Supporting context, highlighted less prominently (typically yellow)
Multi-file Diagnostics
For diagnostics that span multiple files, set the :source field to identify
which file this label refers to.
Examples
# Primary label at the error siteLabel.primary(span,"expected `integer`, found `float`")# Secondary label showing related contextLabel.secondary(decl_span,"declared as `integer` here")# Label in a different fileLabel.primary(span,"error here",source:"lib/other.ex")
Creates a bracket label that highlights a multi-line block.
Bracket labels draw a vertical bar (┃) in the left margin across a range
of lines, with a ╰── message tail below. The span must cover the full
line range (use end_line in the position span).