Documentation
¶
Index ¶
Constants ¶
const ( // SeverityUnspecified is the undefined severity SeverityUnspecified Severity = "" // SeverityWarning is a warning SeverityWarning = "WARNING" // SeverityError is an error SeverityError = "ERROR" // SeverityFatal is a fatal error SeverityFatal = "FATAL" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompilerOutputParserCB ¶
CompilerOutputParserCB is a callback function that is called to feed a parser with the plain-text compiler output.
type Context ¶
type Context struct { Message string `json:"message"` File string `json:"file,omitempty"` Line int `json:"line,omitempty"` Column int `json:"col,omitempty"` }
Context represents a context, i.e. a reference to a file, line and column or a part of the code that a Diagnostic refers to.
func (*Context) ToRPC ¶
func (d *Context) ToRPC() *rpc.CompileDiagnosticContext
ToRPC converts a Context to a rpc.CompileDiagnosticContext
type DetectedCompiler ¶
type DetectedCompiler struct { Name string Family string Version *semver.Version DetailedVersion []string }
DetectedCompiler represents a compiler detected from a given command line
func DetectCompilerFromCommandLine ¶
func DetectCompilerFromCommandLine(args []string, probeCompiler bool) *DetectedCompiler
DetectCompilerFromCommandLine tries to detect a compiler from a given command line. If probeCompiler is true, the compiler may be executed with different flags to infer the version or capabilities.
type Diagnostic ¶
type Diagnostic struct { Severity Severity `json:"severity,omitempty"` Message string `json:"message"` File string `json:"file,omitempty"` Line int `json:"line,omitempty"` Column int `json:"col,omitempty"` Context FullContext `json:"context,omitempty"` Suggestions Notes `json:"suggestions,omitempty"` }
Diagnostic represents a diagnostic (a compiler error, warning, note, etc.)
func ParseCompilerOutput ¶
func ParseCompilerOutput(compiler *DetectedCompiler, out []byte) ([]*Diagnostic, error)
ParseCompilerOutput parses the output of a compiler and returns a list of diagnostics.
func (*Diagnostic) ToRPC ¶
func (d *Diagnostic) ToRPC() *rpc.CompileDiagnostic
ToRPC converts a Diagnostic to a rpc.CompileDiagnostic
type Diagnostics ¶
type Diagnostics []*Diagnostic
Diagnostics represents a list of diagnostics
func (Diagnostics) ToRPC ¶
func (d Diagnostics) ToRPC() []*rpc.CompileDiagnostic
ToRPC converts a Diagnostics to a slice of rpc.CompileDiagnostic
type FullContext ¶
type FullContext []*Context
FullContext represents a list of Context
func (FullContext) ToRPC ¶
func (t FullContext) ToRPC() []*rpc.CompileDiagnosticContext
ToRPC converts a FullContext to a slice of rpc.CompileDiagnosticContext
type Note ¶
type Note struct { Message string `json:"message"` File string `json:"file,omitempty"` Line int `json:"line,omitempty"` Column int `json:"col,omitempty"` }
Note represents a compiler annotation or suggestion
func (*Note) ToRPC ¶
func (s *Note) ToRPC() *rpc.CompileDiagnosticNote
ToRPC converts a Note to a rpc.CompileDiagnosticNote
type Notes ¶
type Notes []*Note
Notes represents a list of Note
func (Notes) ToRPC ¶
func (s Notes) ToRPC() []*rpc.CompileDiagnosticNote
ToRPC converts a Notes to a slice of rpc.CompileDiagnosticNote
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) Diagnostics ¶
func (m *Store) Diagnostics() Diagnostics