diff options
Diffstat (limited to 'clang-tools-extra/clangd/refactor')
-rw-r--r-- | clang-tools-extra/clangd/refactor/Rename.cpp | 6 | ||||
-rw-r--r-- | clang-tools-extra/clangd/refactor/Rename.h | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/clang-tools-extra/clangd/refactor/Rename.cpp b/clang-tools-extra/clangd/refactor/Rename.cpp index 845aae17968..d62e1db52df 100644 --- a/clang-tools-extra/clangd/refactor/Rename.cpp +++ b/clang-tools-extra/clangd/refactor/Rename.cpp @@ -8,7 +8,9 @@ #include "refactor/Rename.h" #include "AST.h" +#include "ClangdUnit.h" #include "Logger.h" +#include "SourceCode.h" #include "index/SymbolCollector.h" #include "clang/Tooling/Refactoring/Rename/RenamingAction.h" #include "clang/Tooling/Refactoring/Rename/USRFinder.h" @@ -151,8 +153,8 @@ findOccurrencesWithinFile(ParsedAST &AST, const NamedDecl *RenameDecl) { llvm::Expected<tooling::Replacements> renameWithinFile(ParsedAST &AST, llvm::StringRef File, Position Pos, llvm::StringRef NewName, const SymbolIndex *Index) { - SourceLocation SourceLocationBeg = clangd::getBeginningOfIdentifier( - AST, Pos, AST.getSourceManager().getMainFileID()); + SourceLocation SourceLocationBeg = getBeginningOfIdentifier( + Pos, AST.getSourceManager(), AST.getASTContext().getLangOpts()); // FIXME: renaming macros is not supported yet, the macro-handling code should // be moved to rename tooling library. if (locateMacroAt(SourceLocationBeg, AST.getPreprocessor())) diff --git a/clang-tools-extra/clangd/refactor/Rename.h b/clang-tools-extra/clangd/refactor/Rename.h index e89ea22734c..63a1ffe3215 100644 --- a/clang-tools-extra/clangd/refactor/Rename.h +++ b/clang-tools-extra/clangd/refactor/Rename.h @@ -9,12 +9,14 @@ #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_REFACTOR_RENAME_H #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_REFACTOR_RENAME_H -#include "ClangdUnit.h" +#include "Protocol.h" #include "clang/Tooling/Core/Replacement.h" #include "llvm/Support/Error.h" namespace clang { namespace clangd { +class ParsedAST; +class SymbolIndex; /// Renames all occurrences of the symbol at \p Pos to \p NewName. /// Occurrences outside the current file are not modified. |