diagnostic

package
v0.0.0-...-ec16dcc Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package diagnostic represents diagnostic information about a Dogma application's source code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Change

type Change struct {
	Message string
	Edits   []Edit
}

Change is related set of edits to a document.

type Diagnostic

type Diagnostic struct {
	Severity   Severity
	Begin, End token.Position
	Message    string
	Suggestion *Change
}

Diagnostic represents a diagnostic message.

func (*Diagnostic) SuggestChange

func (d *Diagnostic) SuggestChange(message string, edits ...Edit) *Diagnostic

SuggestChange adds a set of edits that the user may perform to resolve this diagnostic.

type Edit

type Edit struct {
	Begin, End token.Pos
	Text       string
}

Edit is a single contiguous edit within a document.

type Severity

type Severity int

Severity is an enumeration describing the severity of a diagnostic.

const (
	// Error indicates that the diagnostic describes usage of Dogma that will
	// not function correctly.
	Error Severity = iota

	// Warning indicates that the diagnostic describes usage of Dogma that is
	// not recommended.
	Warning

	// Improvement indicates that the describes usage of Dogma that may be
	// improved, but is not problematic.
	Improvement
)

func (Severity) String

func (s Severity) String() string

Jump to

Keyboard shortcuts

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