Go to the documentation of this file.
9 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_REFACTOR_RENAME_H
10 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_REFACTOR_RENAME_H
14 #include "clang/Basic/LangOptions.h"
15 #include "llvm/Support/Error.h"
41 llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>
FS =
nullptr;
68 llvm::StringRef InitialCode,
69 std::vector<Range> Occurrences,
70 llvm::StringRef NewName);
82 llvm::Optional<std::vector<Range>>
84 std::vector<Range> Indexed,
const LangOptions &
LangOpts);
92 llvm::Optional<std::vector<Range>>
getMappedRanges(ArrayRef<Range> Indexed,
93 ArrayRef<Range> Lexed);
101 ArrayRef<size_t> MappedIndex);
106 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_REFACTOR_RENAME_H
llvm::Expected< RenameResult > rename(const RenameInputs &RInputs)
Renames all occurrences of the symbol.
llvm::Expected< Edit > buildRenameEdit(llvm::StringRef AbsFilePath, llvm::StringRef InitialCode, std::vector< Range > Occurrences, llvm::StringRef NewName)
Generates rename edits that replaces all given occurrences with the NewName.
std::vector< Range > LocalChanges
llvm::Optional< std::vector< Range > > getMappedRanges(ArrayRef< Range > Indexed, ArrayRef< Range > Lexed)
Calculates the lexed occurrences that the given indexed occurrences map to.
Interface for symbol indexes that can be used for searching or matching symbols among a set of symbol...
size_t LimitFiles
The maximum number of affected files (0 means no limit), only meaningful when AllowCrossFile = true.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
size_t renameRangeAdjustmentCost(ArrayRef< Range > Indexed, ArrayRef< Range > Lexed, ArrayRef< size_t > MappedIndex)
Evaluates how good the mapped result is.
llvm::StringMap< Edit > FileEdits
A mapping from absolute file path (the one used for accessing the underlying VFS) to edits.
Stores and provides access to parsed AST.
llvm::Optional< std::vector< Range > > adjustRenameRanges(llvm::StringRef DraftCode, llvm::StringRef Identifier, std::vector< Range > Indexed, const LangOptions &LangOpts)
Adjusts indexed occurrences to match the current state of the file.
bool WantFormat
If true, format the rename edits, only meaningful in ClangdServer layer.