summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/refactor/Rename.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clangd/refactor/Rename.cpp')
-rw-r--r--clang-tools-extra/clangd/refactor/Rename.cpp6
1 files changed, 4 insertions, 2 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()))
OpenPOWER on IntegriCloud