mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SourceKit] Hide RenameRangeDetailCollector as an implementation detail
The usage becomes a lot clearer if there’s just a top-level function that returns the details for the syntactic rename ranges.
This commit is contained in:
@@ -12,7 +12,6 @@
|
||||
|
||||
#include "ExtractExprBase.h"
|
||||
#include "RefactoringActions.h"
|
||||
#include "RenameRangeDetailCollector.h"
|
||||
#include "Utils.h"
|
||||
#include "swift/AST/DiagnosticsRefactoring.h"
|
||||
#include "swift/IDETool/CompilerInvocation.h"
|
||||
@@ -109,9 +108,9 @@ static std::vector<NoteRegion> getNotableRegions(StringRef SourceText,
|
||||
RenameLoc RenameConfig = {LineAndCol.first, LineAndCol.second,
|
||||
NameUsage::Definition, /*OldName=*/Name,
|
||||
IsFunctionLike};
|
||||
RenameRangeDetailCollector Renamer(SM, Name);
|
||||
Renamer.addSyntacticRenameRanges(Resolved.back(), RenameConfig);
|
||||
auto Ranges = Renamer.getResult();
|
||||
std::vector<RenameRangeDetail> Ranges =
|
||||
getSyntacticRenameRangeDetails(SM, Name, Resolved.back(), RenameConfig)
|
||||
.Ranges;
|
||||
|
||||
std::vector<NoteRegion> NoteRegions(Ranges.size());
|
||||
llvm::transform(Ranges, NoteRegions.begin(),
|
||||
|
||||
Reference in New Issue
Block a user