diags

package
v0.85.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InjectDiagnostics

func InjectDiagnostics(content string, d []Diagnostic, color output.Color) string

Types

type Diagnostic

type Diagnostic struct {
	Expr        promParser.Node `yaml:"-"`
	Message     string
	Pos         PositionRanges `yaml:"-"`
	FirstColumn int            // 1-indexed
	LastColumn  int            // 1-indexed
	Kind        Kind
}

type Kind added in v0.74.0

type Kind uint8
const (
	Issue Kind = iota
	Context
)

type LineRange

type LineRange struct {
	First int
	Last  int
}

func (LineRange) Expand

func (lr LineRange) Expand() []int

func (LineRange) String

func (lr LineRange) String() string

type PositionRange

type PositionRange struct {
	Line        int // 1-indexed
	FirstColumn int // 1-indexed
	LastColumn  int // 1-indexed
}

type PositionRanges

type PositionRanges []PositionRange

func NewPositionRange

func NewPositionRange(lines []string, val *yaml.Node, minColumn int) (offsets PositionRanges)

func (PositionRanges) AddOffset

func (prs PositionRanges) AddOffset(line, column int)

func (PositionRanges) Len

func (prs PositionRanges) Len() (l int)

func (PositionRanges) Lines

func (prs PositionRanges) Lines() (lr LineRange)

Jump to

Keyboard shortcuts

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