@@ -72,7 +72,7 @@ struct RenameRangeDetail {
72
72
Optional<unsigned > Index;
73
73
};
74
74
75
- enum class RenameAvailableKind {
75
+ enum class RefactorAvailableKind {
76
76
Available,
77
77
Unavailable_system_symbol,
78
78
Unavailable_has_no_location,
@@ -81,14 +81,14 @@ enum class RenameAvailableKind {
81
81
Unavailable_decl_from_clang,
82
82
};
83
83
84
- struct RenameAvailabilityInfo {
84
+ struct RefactorAvailabilityInfo {
85
85
RefactoringKind Kind;
86
- RenameAvailableKind AvailableKind;
87
- RenameAvailabilityInfo (RefactoringKind Kind,
88
- RenameAvailableKind AvailableKind)
86
+ RefactorAvailableKind AvailableKind;
87
+ RefactorAvailabilityInfo (RefactoringKind Kind,
88
+ RefactorAvailableKind AvailableKind)
89
89
: Kind(Kind), AvailableKind(AvailableKind) {}
90
- RenameAvailabilityInfo (RefactoringKind Kind)
91
- : RenameAvailabilityInfo (Kind, RenameAvailableKind ::Available) {}
90
+ RefactorAvailabilityInfo (RefactoringKind Kind)
91
+ : RefactorAvailabilityInfo (Kind, RefactorAvailableKind ::Available) {}
92
92
};
93
93
94
94
class FindRenameRangesConsumer {
@@ -112,7 +112,7 @@ class FindRenameRangesAnnotatingConsumer : public FindRenameRangesConsumer {
112
112
113
113
StringRef getDescriptiveRefactoringKindName (RefactoringKind Kind);
114
114
115
- StringRef getDescriptiveRenameUnavailableReason (RenameAvailableKind Kind);
115
+ StringRef getDescriptiveRenameUnavailableReason (RefactorAvailableKind Kind);
116
116
117
117
bool refactorSwiftModule (ModuleDecl *M, RefactoringOptions Opts,
118
118
SourceEditConsumer &EditConsumer,
@@ -131,25 +131,13 @@ int findLocalRenameRanges(SourceFile *SF, RangeConfig Range,
131
131
FindRenameRangesConsumer &RenameConsumer,
132
132
DiagnosticConsumer &DiagConsumer);
133
133
134
- void collectAvailableRefactorings (
135
- SourceFile *SF, RangeConfig Range, bool &RangeStartMayNeedRename,
136
- llvm::SmallVectorImpl<RefactoringKind> &Kinds,
137
- llvm::ArrayRef<DiagnosticConsumer *> DiagConsumers);
138
-
139
- void collectAvailableRefactorings (ResolvedCursorInfoPtr CursorInfo,
140
- llvm::SmallVectorImpl<RefactoringKind> &Kinds,
141
- bool ExcludeRename);
142
-
143
- // / Stores information about the reference that rename availability is being
144
- // / queried on.
145
- struct RenameRefInfo {
146
- SourceFile *SF; // /< The source file containing the reference.
147
- SourceLoc Loc; // /< The reference's source location.
148
- bool IsArgLabel; // /< Whether Loc is on an arg label, rather than base name.
149
- };
134
+ SmallVector<RefactorAvailabilityInfo, 0 >
135
+ collectRefactorings (SourceFile *SF, RangeConfig Range,
136
+ bool &RangeStartMayNeedRename,
137
+ llvm::ArrayRef<DiagnosticConsumer *> DiagConsumers);
150
138
151
- Optional<RenameAvailabilityInfo >
152
- renameAvailabilityInfo ( const ValueDecl *VD, Optional<RenameRefInfo> RefInfo );
139
+ SmallVector<RefactorAvailabilityInfo, 0 >
140
+ collectRefactorings (ResolvedCursorInfoPtr CursorInfo, bool ExcludeRename );
153
141
154
142
} // namespace ide
155
143
} // namespace swift
0 commit comments