report

package
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DiagnosticError   DiagnosticKind = "error"
	DiagnosticInfo                   = "info"
	DiagnosticWarning                = "warning"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Diagnostic

type Diagnostic struct {
	TextRange TextRange      `json:"textRange"`
	Message   string         `json:"message"`
	Kind      DiagnosticKind `json:"kind"`
}

type DiagnosticKind

type DiagnosticKind string

type Output

type Output interface {
	Print(writer io.Writer) error
}

func NewRenderingOutput

func NewRenderingOutput(report Report, lineMap *linemap.LineMap) Output

func NewSerializingOutput

func NewSerializingOutput(format SerializationFormat, report Report) Output

type Position

type Position struct {
	Line   int `json:"line"`
	Column int `json:"column"`
	Offset int `json:"offset"`
}

type PositionRange

type PositionRange struct {
	BeginPosition Position `json:"beginPosition"`
	EndPosition   Position `json:"endPosition"`
}

type Report

type Report struct {
	Success     bool         `json:"success"`
	Time        Time         `json:"time"`
	Diagnostics []Diagnostic `json:"diagnostics"`
}

type SerializationFormat

type SerializationFormat struct {
	// contains filtered or unexported fields
}

func NewJsonSerializationFormat

func NewJsonSerializationFormat() SerializationFormat

func NewPrettyJsonSerializationFormat

func NewPrettyJsonSerializationFormat() SerializationFormat

func NewPrettyXmlSerializationFormat

func NewPrettyXmlSerializationFormat() SerializationFormat

func NewXmlSerializationFormat

func NewXmlSerializationFormat() SerializationFormat

func (SerializationFormat) Marshal

func (format SerializationFormat) Marshal(report Report) ([]byte, error)

func (SerializationFormat) Unmarshal

func (format SerializationFormat) Unmarshal(bytes []byte) (Report, error)

type TextRange

type TextRange struct {
	Text  string        `json:"text"`
	Range PositionRange `json:"range"`
	File  string        `json:"file"`
}

type Time

type Time struct {
	Begin      int64 `json:"begin"`
	Completion int64 `json:"completion"`
}

func (Time) CalculateDuration

func (time Time) CalculateDuration() times.Duration

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL