[SourceKit] Remove newName from RenameLoc

We should (and do) have one new name for the entire rename operation, not a separate new name for different positions at which the renamed symbol occurs.
This commit is contained in:
Alex Hoppen
2023-11-13 16:12:40 -08:00
parent bc3c8fc47a
commit d095d0a186
9 changed files with 70 additions and 78 deletions

View File

@@ -1412,7 +1412,8 @@ void SwiftLangSupport::findRenameRanges(
auto RenameLocs = getSyntacticRenameLocs(RenameLocations);
RequestRenameRangeConsumer Consumer(Receiver);
swift::ide::findSyntacticRenameRanges(SF, RenameLocs, Consumer, Consumer);
swift::ide::findSyntacticRenameRanges(SF, RenameLocs, /*NewName=*/StringRef(),
Consumer, Consumer);
}
void SwiftLangSupport::findLocalRenameRanges(
@@ -1504,8 +1505,9 @@ getSyntacticRenameLocs(ArrayRef<RenameLocations> RenameLocations) {
for(const auto &Locations: RenameLocations) {
for(const auto &Location: Locations.LineColumnLocs) {
RenameLocs.push_back({Location.Line, Location.Column,
getNameUsage(Location.Type), Locations.OldName, Locations.NewName,
Locations.IsFunctionLike, Locations.IsNonProtocolType});
getNameUsage(Location.Type), Locations.OldName,
Locations.IsFunctionLike,
Locations.IsNonProtocolType});
}
}
return RenameLocs;