Documentation
¶
Index ¶
Constants ¶
View Source
const JSONSchemaVersion = 1
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Code ¶ added in v0.2.4
type Code string
Code is a stable, machine-readable diagnostic identifier. Messages may be improved without changing integrations that use the code.
type Diagnostic ¶
type Diagnostic struct {
Code Code
Severity Severity
Message string
Path string
Span token.Span
Related []RelatedInformation
Fixes []Fix
}
func Normalize ¶ added in v0.2.4
func Normalize(items []Diagnostic, path string, fallback Code) []Diagnostic
Normalize fills phase and source defaults without replacing more specific information recorded at the diagnostic's origin.
func (Diagnostic) String ¶
func (d Diagnostic) String() string
type Fix ¶ added in v0.2.4
Fix describes one coherent source change. A fix may contain multiple edits so refactors such as adding an import and replacing a name remain atomic.
type JSONDiagnostic ¶ added in v0.2.4
type JSONDiagnostic struct {
Code Code `json:"code"`
Severity Severity `json:"severity"`
Message string `json:"message"`
Location *JSONLocation `json:"location,omitempty"`
RelatedInformation []JSONRelatedInformation `json:"relatedInformation,omitempty"`
Fixes []JSONFix `json:"fixes,omitempty"`
}
type JSONFix ¶ added in v0.2.4
type JSONFix struct {
Message string `json:"message"`
Edits []JSONTextEdit `json:"edits"`
}
type JSONLocation ¶ added in v0.2.4
type JSONPosition ¶ added in v0.2.4
type JSONRelatedInformation ¶ added in v0.2.4
type JSONRelatedInformation struct {
Message string `json:"message"`
Location JSONLocation `json:"location"`
}
type JSONReport ¶ added in v0.2.4
type JSONReport struct {
SchemaVersion int `json:"schemaVersion"`
ToolVersion string `json:"toolVersion,omitempty"`
Diagnostics []JSONDiagnostic `json:"diagnostics"`
Summary JSONSummary `json:"summary"`
}
func NewJSONReport ¶ added in v0.2.4
func NewJSONReport(items []Diagnostic) JSONReport
type JSONSpan ¶ added in v0.2.4
type JSONSpan struct {
Start JSONPosition `json:"start"`
End JSONPosition `json:"end"`
}
type JSONSummary ¶ added in v0.2.4
type JSONTextEdit ¶ added in v0.2.4
type JSONTextEdit struct {
Location JSONLocation `json:"location"`
Replacement string `json:"replacement"`
}
type RelatedInformation ¶ added in v0.2.4
Click to show internal directories.
Click to hide internal directories.