Documentation
¶
Overview ¶
Package udiff provides parsing and application of unified diffs with elision support.
The format supports:
- Standard unified diff headers (--- and +++)
- Context headers (@@ func Name @@) for locating code
- Elision markers (-...) for matching large blocks without listing every line
- Context lines (space prefix), remove lines (-), and add lines (+)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ApplyResult ¶ added in v0.0.7
type ApplyResult struct {
Content string // Modified content (with successful hunks applied)
Warnings []string // Warnings for hunks that failed to apply
}
ApplyResult contains the result of applying hunks with warnings for failures.
func ApplyWithWarnings ¶ added in v0.0.7
func ApplyWithWarnings(content string, hunks []Hunk) ApplyResult
ApplyWithWarnings applies hunks, skipping failures and collecting warnings. Returns modified content with all successful hunks applied.
type Hunk ¶
type Hunk struct {
Context string // The @@ header content (e.g., "func ProcessData")
Lines []Line // All lines in order
}
Hunk represents a single change block within a file diff.
Click to show internal directories.
Click to hide internal directories.