check

package
v0.6.21 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Diagnostic

type Diagnostic struct {
	OriginalSrc string // Complete original src
	Range       Range
	RangedSrc   string // Src for just the Range
	LineSrc     string // Src for the line at the start of Range
	Severity    Severity
	Message     string
	Code        *rl.Error
}

func NewDiagnosticError

func NewDiagnosticError(node *ts.Node, originalSrc string, msg string, code rl.Error) Diagnostic

func NewDiagnosticFromNode

func NewDiagnosticFromNode(
	node *ts.Node,
	originalSrc string,
	severity Severity,
	msg string,
	code *rl.Error,
) Diagnostic

func NewDiagnosticHint added in v0.6.15

func NewDiagnosticHint(node *ts.Node, originalSrc string, msg string, code rl.Error) Diagnostic

func NewDiagnosticWarn added in v0.6.17

func NewDiagnosticWarn(node *ts.Node, originalSrc string, msg string, code rl.Error) Diagnostic

type Opts

type Opts struct {
	Errors bool
	Warns  bool
	Lints  bool
}

todo mostly unused atm

func NewOpts

func NewOpts() Opts

type Pos

type Pos struct {
	Line      int `json:"line"`      // Zero-indexed
	Character int `json:"character"` // Zero-indexed
}

type RadChecker

type RadChecker interface {
	UpdateSrc(src string)
	CheckDefault() (Result, error)
	Check(Opts) (Result, error)
}

func NewChecker

func NewChecker() (RadChecker, error)

func NewCheckerWithTree

func NewCheckerWithTree(tree *rts.RadTree, parser *rts.RadParser, src string) RadChecker

type RadCheckerImpl

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

func (*RadCheckerImpl) Check

func (c *RadCheckerImpl) Check(opts Opts) (Result, error)

todo use opts

func (*RadCheckerImpl) CheckDefault

func (c *RadCheckerImpl) CheckDefault() (Result, error)

func (*RadCheckerImpl) UpdateSrc

func (c *RadCheckerImpl) UpdateSrc(src string)

type Range

type Range struct {
	Start Pos `json:"start"`
	End   Pos `json:"end"`
}

type Result

type Result struct {
	// todo Rad versions
	Diagnostics []Diagnostic
}

type Severity

type Severity int
const (
	Hint Severity = iota
	Warning
	Info
	Error
)

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