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"
46 llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>
FS =
nullptr;
73 llvm::StringRef InitialCode,
74 std::vector<Range> Occurrences,
75 llvm::StringRef NewName);
87std::optional<std::vector<Range>>
89 std::vector<Range> Indexed,
const LangOptions &LangOpts);
97std::optional<std::vector<Range>>
getMappedRanges(ArrayRef<Range> Indexed,
98 ArrayRef<Range> Lexed);
106 ArrayRef<size_t> MappedIndex);
Stores and provides access to parsed AST.
Interface for symbol indexes that can be used for searching or matching symbols among a set of 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.
llvm::StringMap< Edit > FileEdits
A mapping from absolute file path (the one used for accessing the underlying VFS) to edits.
std::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.
llvm::Expected< RenameResult > rename(const RenameInputs &RInputs)
Renames all occurrences of the symbol.
std::optional< std::vector< Range > > getMappedRanges(ArrayRef< Range > Indexed, ArrayRef< Range > Lexed)
Calculates the lexed occurrences that the given indexed occurrences map to.
size_t renameRangeAdjustmentCost(ArrayRef< Range > Indexed, ArrayRef< Range > Lexed, ArrayRef< size_t > MappedIndex)
Evaluates how good the mapped result is.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
size_t LimitFiles
The maximum number of affected files (0 means no limit), only meaningful when AllowCrossFile = true.
bool WantFormat
If true, format the rename edits, only meaningful in ClangdServer layer.
bool RenameVirtual
Allow rename of virtual method hierarchies.
std::vector< Range > LocalChanges