mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[SourceKit] Merge local refactoring implementations
Retrieving local rename ranges and the local rename refactoring both had almost identical methods, except for the addition of retrieving the outermost shadowed decl that was added a couple months back. Merge them. Resolves rdar://106529370.
This commit is contained in:
@@ -704,14 +704,14 @@ static bool passCursorInfoForModule(ModuleEntity Mod,
|
||||
static void
|
||||
collectAvailableRenameInfo(const ValueDecl *VD, Optional<RenameRefInfo> RefInfo,
|
||||
SmallVectorImpl<RefactoringInfo> &Refactorings) {
|
||||
SmallVector<RenameAvailabilityInfo, 2> Renames;
|
||||
collectRenameAvailabilityInfo(VD, RefInfo, Renames);
|
||||
for (auto Info : Renames) {
|
||||
Refactorings.emplace_back(
|
||||
SwiftLangSupport::getUIDForRefactoringKind(Info.Kind),
|
||||
ide::getDescriptiveRefactoringKindName(Info.Kind),
|
||||
ide::getDescriptiveRenameUnavailableReason(Info.AvailableKind));
|
||||
}
|
||||
Optional<RenameAvailabilityInfo> Info = renameAvailabilityInfo(VD, RefInfo);
|
||||
if (!Info)
|
||||
return;
|
||||
|
||||
Refactorings.emplace_back(
|
||||
SwiftLangSupport::getUIDForRefactoringKind(Info->Kind),
|
||||
ide::getDescriptiveRefactoringKindName(Info->Kind),
|
||||
ide::getDescriptiveRenameUnavailableReason(Info->AvailableKind));
|
||||
}
|
||||
|
||||
static void collectAvailableRefactoringsOtherThanRename(
|
||||
|
||||
Reference in New Issue
Block a user