[SourceKit] Merge RenameLoc and RenameLocation

It’s easier to understand the code if we don’t have these two nearly, but not quite, identical types.
This commit is contained in:
Alex Hoppen
2023-11-17 18:09:09 -08:00
parent d4ee4fa308
commit e538a5ed61
11 changed files with 145 additions and 153 deletions

View File

@@ -19,6 +19,7 @@
#include "swift/AST/Type.h"
#include "swift/IDE/CancellableResult.h"
#include "swift/IDE/CodeCompletionResult.h"
#include "swift/Refactoring/RenameLoc.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h"
#include "llvm/ADT/Optional.h"
@@ -37,6 +38,7 @@ namespace llvm {
namespace SourceKit {
class GlobalConfig;
using swift::ide::CancellableResult;
using swift::ide::RenameLoc;
struct EntityInfo {
UIdent Kind;
@@ -893,25 +895,6 @@ struct CategorizedRenameRanges {
std::vector<RenameRangeDetail> Ranges;
};
enum class RenameType {
Unknown,
Definition,
Reference,
Call
};
struct RenameLocation {
unsigned Line;
unsigned Column;
RenameType Type;
};
struct RenameLocations {
StringRef OldName;
const bool IsFunctionLike;
std::vector<RenameLocation> LineColumnLocs;
};
struct IndexStoreOptions {
std::string IndexStorePath;
std::string IndexUnitOutputPath;
@@ -1192,7 +1175,7 @@ public:
virtual CancellableResult<std::vector<CategorizedRenameRanges>>
findRenameRanges(llvm::MemoryBuffer *InputBuf,
ArrayRef<RenameLocations> RenameLocations,
ArrayRef<RenameLoc> RenameLocations,
ArrayRef<const char *> Args) = 0;
virtual void
findLocalRenameRanges(StringRef Filename, unsigned Line, unsigned Column,