analyzer

package
v1.8.16 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	DiagnosticIndex int
	RuleID          string
	Title           string
	Path            string
	Range           Range
	Edits           []Edit
}

type Analyzer

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

func New

func New() *Analyzer

func (*Analyzer) Analyze

func (a *Analyzer) Analyze(ctx context.Context, request Request) (Result, error)

type CacheStats

type CacheStats struct {
	Hits   int
	Misses int
}

type Diagnostic

type Diagnostic struct {
	RuleID   string
	Code     string
	Severity string
	Category string
	Message  string
	Path     string
	Range    Range
	Related  []RelatedLocation
}

type Edit

type Edit struct {
	Range   Range
	NewText string
}

type Position

type Position struct {
	Offset int
	Line   int
	Column int
}

type Range

type Range struct {
	Start Position
	End   Position
}

type RelatedLocation

type RelatedLocation struct {
	Range   Range
	Message string
}

type Request

type Request struct {
	Sources          []Source
	ConfigPath       string
	WorkingDirectory string
	Build            string
	IncludePaths     []string
	Defines          []string
	DefinesComplete  bool
}

type Result

type Result struct {
	Diagnostics []Diagnostic
	SafeEdits   []Action
	Suggestions []Action
	Migrations  []RuleMigration
	Cache       CacheStats
}

func Analyze

func Analyze(ctx context.Context, request Request) (Result, error)

type RuleMigration

type RuleMigration struct {
	Deprecated  string
	Replacement string
}

type Source

type Source struct {
	Path    string
	Content []byte
}

Jump to

Keyboard shortcuts

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