diffanchor

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SideRight = "RIGHT"
	SideLeft  = "LEFT"
)

Variables

This section is empty.

Functions

func DowngradeBody

func DowngradeBody(body string, anchor Anchor, reason string) string

func FallbackBody

func FallbackBody(body string, anchor Anchor, reason string) string

func FallbackLocation

func FallbackLocation(anchor Anchor) string

Types

type Anchor

type Anchor struct {
	Path      string
	Line      int64
	Side      string
	StartLine int64
	StartSide string
}

type Index

type Index struct {
	Ranges []Range
}

func Parse

func Parse(diff string) Index

func (Index) FormatPromptSection

func (idx Index) FormatPromptSection(limit int) string

func (Index) Validate

func (idx Index) Validate(anchor Anchor) ValidationResult

type Range

type Range struct {
	Path    string
	Side    string
	Start   int64
	End     int64
	Excerpt string
	Heading string
}

type ValidationResult

type ValidationResult struct {
	Valid          bool
	Reason         string
	LocationText   string
	QualityFlagged bool
}

func ValidateTopLevelLocation

func ValidateTopLevelLocation(body string) ValidationResult

Jump to

Keyboard shortcuts

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