Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Annotation ¶
type Annotation struct { File *file.File // ContextStart and ContextEnd are the lines of input relevant to the // annotation, which are printed when the Pretty is called. // // Usually that is the line on which the error occurred, however, the // context may be larger if there is more relevant information to show. // For example a mixin argument error may choose to include the point when // the mixin was called. // // ContextStart is inclusive and ContextEnd is exclusive. ContextStart, ContextEnd int // Line is the line of the annotation. // It must lie between ContextStart and ContextEnd. Line int // Start and End specify the col range to be highlighted. // // Note that Start and End may exceed the actual line length. // // This is, for example, useful to highlight a missing token at the end of // a line. // // Start is inclusive and End is exclusive. Start, End int Annotation string // Lines are the lines that are annotated, starting with the line with the // number ContextStart. Lines []string // contains filtered or unexported fields }
type Error ¶
type Error struct { Message string ErrorAnnotation Annotation HintAnnotations []Annotation Example string ShouldBe string Suggestions []Suggestion // Cause is the cause of the error, if it has one Cause error }
func (*Error) Pretty ¶
func (err *Error) Pretty(o PrettyOptions) string
type List ¶
type List []*Error //nolint:errname
List represents a collection of Error objects.
func (List) Error ¶
Error calls Error.Error for each item in the list, separating them by newlines.
func (List) Pretty ¶
func (l List) Pretty(o PrettyOptions) string
Pretty calls Error.Pretty on each item in the list, separating each error by two newlines (effectively leaving a single blank line in-between errors).
type PrettyOptions ¶
Click to show internal directories.
Click to hide internal directories.