Documentation
¶
Overview ¶
Package errorformat provides 'errorformat' functionality of Vim. :h errorformat
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Efm ¶
type Efm struct {
// contains filtered or unexported fields
}
Efm represents a errorformat.
type Entry ¶
type Entry struct {
// name of a file
Filename string `json:"filename"`
// line number
Lnum int `json:"lnum"`
// End of line number if the item is multiline
EndLnum int `json:"end_lnum"`
// column number (first column is 1)
Col int `json:"col"`
// End of column number if the item has range
EndCol int `json:"end_col"`
// true: "col" is visual column
// false: "col" is byte index
Vcol bool `json:"vcol"`
// error number
Nr int `json:"nr"`
// search pattern used to locate the error
Pattern string `json:"pattern"`
// description of the error
Text string `json:"text"`
// type of the error, 'E', '1', etc.
Type rune `json:"type"`
// true: recognized error message
Valid bool `json:"valid"`
// Original error lines (often one line. more than one line for multi-line
// errorformat. :h errorformat-multi-line)
Lines []string `json:"lines"`
}
Entry represents matched entry of errorformat, equivalent to Vim's quickfix list item.
type Errorformat ¶
type Errorformat struct {
Efms []*Efm
}
Errorformat provides errorformat feature.
func NewErrorformat ¶
func NewErrorformat(efms []string) (*Errorformat, error)
NewErrorformat compiles given errorformats string (efms) and returns a new Errorformat. It returns error if the errorformat is invalid.
func (*Errorformat) NewScanner ¶
func (errorformat *Errorformat) NewScanner(r io.Reader) *Scanner
NewScanner returns a new Scanner to read from r.
type Match ¶
type Match struct {
F string // (%f) file name
N int // (%n) error number
L int // (%l) line number
C int // (%c) column number
T byte // (%t) error type
M string // (%m) error message
R string // (%r) the "rest" of a single-line file message
P string // (%p) pointer line
V int // (%v) virtual column number
S string // (%s) search text
// Extensions
E int // (%e) end line number
K int // (%k) end column number
}
Match represents match of Efm. ref: Basic items in :h errorformat
type Scanner ¶
type Scanner struct {
*Errorformat
// contains filtered or unexported fields
}
Scanner provides a interface for scanning compiler/linter/static analyzer result using Errorformat.
Click to show internal directories.
Click to hide internal directories.