// SearchAndReplace locates text edits and replaces with them.
SearchAndReplace locates text edits and replaces with them.
// SearchAndReplace locates text edits and replaces with them .
func (f *BaseFixing) SearchAndReplace(startPos meta.Position, lex func(lex *lexer.Lexer) TextEdit) error {
	r := bytes.NewReader(f.content)
	_, err := r.Seek(int64(startPos.Offset), 0)
	if err != nil {
		return err
	}
	l := lexer.NewLexer(r)
	t := lex(l)
	t.Pos += startPos.Offset
	t.End += startPos.Offset
	f.textEdits = append(f.textEdits, t)
	return nil
}
func ( f * BaseFixing ) SearchAndReplace ( startPos meta . Position , lex func ( lex * lexer . Lexer ) TextEdit ) error { r := bytes . NewReader ( f . content ) _ , err := r . Seek ( int64 ( startPos . Offset ) , 0 ) if err != nil { return err } l := lexer . NewLexer ( r ) t := lex ( l ) t . Pos += startPos . Offset t . End += startPos . Offset f . textEdits = append ( f . textEdits , t ) return nil }
SearchAndReplace locates text edits and replaces with them.
SearchAndReplace locates text edits and replaces with them .