Documentation
¶
Overview ¶
Package diagnostic provides Rust-style annotated error rendering for ELPS CLI output. It is intentionally independent of the lisp/ package so that it can be used by any CLI command without creating import cycles.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Diagnostic ¶
type Diagnostic struct {
Severity Severity
Message string
Spans []Span
Notes []string // "= note:" lines (stack trace frames, etc.)
}
Diagnostic represents a single error, warning, or note with optional source annotations and trailing notes.
type Renderer ¶
type Renderer struct {
// Color controls ANSI color output. Default is ColorAuto.
Color ColorMode
// SourceReader reads source file contents. If nil, os.ReadFile is used.
SourceReader func(string) ([]byte, error)
}
Renderer formats diagnostics as Rust-style annotated source snippets.
type Span ¶
type Span struct {
File string // path for reading source; display name if unreadable
Line int // 1-based line number
Col int // 1-based start column
EndCol int // 1-based end column (0 = auto-detect from source)
Label string // text shown under the underline
}
Span identifies a region of source code to highlight in the diagnostic.
Click to show internal directories.
Click to hide internal directories.