Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fmt
  • Loading branch information
isaacphi committed May 2, 2025
commit 3af58eb6f7b97bbae19f5d194d572571bee6ae84
6 changes: 3 additions & 3 deletions internal/tools/rename-symbol.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func RenameSymbol(ctx context.Context, client *lsp.Client, filePath string, line

// Create a slice to store all changes before sorting and writing
type FileChanges struct {
URI string
URI string
Locations string
}
var allChanges []FileChanges
Expand Down Expand Up @@ -101,12 +101,12 @@ func RenameSymbol(ctx context.Context, client *lsp.Client, filePath string, line
changeCount += len(change.TextDocumentEdit.Edits)
}
}

// Sort changes by filename for consistent output
sort.Slice(allChanges, func(i, j int) bool {
return allChanges[i].URI < allChanges[j].URI
})

// Write sorted changes to the output builder
for _, change := range allChanges {
locationsBuilder.WriteString(fmt.Sprintf("%s: %s\n", change.URI, change.Locations))
Expand Down
Loading