@@ -34,9 +34,9 @@ func applyTextEdits(uri protocol.DocumentUri, edits []protocol.TextEdit) error {
34 lines := strings.Split(string(content), lineEnding)
34 lines := strings.Split(string(content), lineEnding)
36 // Check for overlapping edits
36 // Check for overlapping edits
37− for i := 0; i < len(edits); i++ {
37+ for i, edit1 := range edits {
38 for j := i + 1; j < len(edits); j++ {
38 for j := i + 1; j < len(edits); j++ {
39− if rangesOverlap(edits[i].Range, edits[j].Range) {
39+ if rangesOverlap(edit1.Range, edits[j].Range) {
40 return fmt.Errorf("overlapping edits detected between edit %d and %d", i, j)
40 return fmt.Errorf("overlapping edits detected between edit %d and %d", i, j)
@@ -54,7 +54,7 @@ func applyTextEdits(uri protocol.DocumentUri, edits []protocol.TextEdit) error {
55 // Apply each edit
55 // Apply each edit
56 for _, edit := range sortedEdits {
56 for _, edit := range sortedEdits {
57− newLines, err := applyTextEdit(lines, edit, lineEnding)
57+ newLines, err := applyTextEdit(lines, edit)
58 if err != nil {
58 if err != nil {
59 return fmt.Errorf("failed to apply edit: %w", err)
59 return fmt.Errorf("failed to apply edit: %w", err)
@@ -82,7 +82,7 @@ func applyTextEdits(uri protocol.DocumentUri, edits []protocol.TextEdit) error {
82 return nil
82 return nil
85−func applyTextEdit(lines []string, edit protocol.TextEdit, lineEnding string) ([]string, error) {
85+func applyTextEdit(lines []string, edit protocol.TextEdit) ([]string, error) {
86 startLine := int(edit.Range.Start.Line)
86 startLine := int(edit.Range.Start.Line)
87 endLine := int(edit.Range.End.Line)
87 endLine := int(edit.Range.End.Line)
88 startChar := int(edit.Range.Start.Character)
88 startChar := int(edit.Range.Start.Character)