ClangRefactoring: use sourceUsagesAt instead of locationsAt

Change-Id: I085b243b6e0ea4b786ce5c5f5a6894345f9d87eb
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Ivan Donchevskii
2017-10-24 13:39:36 +02:00
parent 327b368ab6
commit 7fb80595b9
4 changed files with 10 additions and 14 deletions

View File

@@ -98,15 +98,7 @@ CppTools::Usages RefactoringEngine::locationsAt(const CppTools::CursorInEditor &
const QByteArray filePath = data.filePath().toString().toLatin1();
const ClangBackEnd::FilePathId filePathId = m_filePathCache.filePathId(filePath.constData());
ClangRefactoring::SourceLocations usages = m_symbolQuery.locationsAt(filePathId, line,
column + 1);
CppTools::Usages result;
result.reserve(usages.size());
for (const auto &location : usages) {
const Utils::SmallStringView path = m_filePathCache.filePath(location.filePathId).path();
result.push_back({path, location.line, location.column});
}
return result;
return m_symbolQuery.sourceUsagesAt(filePathId, line, column + 1);
}
void RefactoringEngine::globalRename(const CppTools::CursorInEditor &data,