Documentation
¶
Overview ¶
Package fuzzy finds the text an edit means to replace when the model's copy of it is not byte for byte the file's: nine strategies from an exact match to similarity scoring, each tried in turn, with the guards that keep a near miss from editing the wrong place
Index ¶
Constants ¶
const DidYouMean = "\n\nDid you mean one of these sections?\n"
Lead of the closest lines hint appended to a no match failure
const NoMatch = "Could not find a match for old_string in the file"
Failure of a replace whose old_string matches nowhere in the file
Variables ¶
This section is empty.
Functions ¶
func Applied ¶
Whether a re sent edit already landed: its new text, of some length, is in the content and its old text is gone; content compared as a reader shows it
func BoundaryNote ¶
Note for an edit a similarity strategy located, empty when every strategy matched exactly
func HoldsNoMatch ¶
Whether a failure text is or carries a no match failure
func NoMatchHint ¶
Did you mean snippet for a failure that found no match at all, empty for any other
Types ¶
type Result ¶
type Result struct {
Content string
// Spans replaced
Count int
// Strategy that found them
Strategy string
// What an escape drift correction changed before matching, empty when nothing was corrected
Note string
}
Outcome of a replace