mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user