forked from qt-creator/qt-creator
ClangCodeModel: Adapt clangd test to upstream change
See https://reviews.llvm.org/D110324. Change-Id: I9dbc03dd814392939be28d1943515d581f9f5b58 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -1119,7 +1119,7 @@ void ClangdClient::Private::handleFindUsagesResult(quint64 key, const QList<Loca
|
||||
finishSearch(*refData, true);
|
||||
});
|
||||
|
||||
for (const Location &loc : locations) // TODO: Can contain duplicates. Rather fix in clang than work around it here.
|
||||
for (const Location &loc : locations)
|
||||
refData->fileData[loc.uri()].rangesAndLineText << qMakePair(loc.range(), QString()); // TODO: Can we assume that locations for the same file are grouped?
|
||||
for (auto it = refData->fileData.begin(); it != refData->fileData.end(); ++it) {
|
||||
const QStringList lines = SymbolSupport::getFileContents(it.key().toFilePath());
|
||||
|
@@ -232,10 +232,11 @@ void ClangdTestFindReferences::test_data()
|
||||
QTest::newRow("direct member initialization") << "defs.h" << 101 << ItemList{
|
||||
makeItem(5, 21, Usage::Type::Initialization), makeItem(45, 16, Usage::Type::Read)};
|
||||
|
||||
// FIXME: The override gets reported twice. clangd bug?
|
||||
QTest::newRow("pure virtual declaration") << "defs.h" << 420 << ItemList{
|
||||
makeItem(17, 17, Usage::Type::Declaration), makeItem(21, 9, Usage::Type::Declaration),
|
||||
ItemList pureVirtualRefs{makeItem(17, 17, Usage::Type::Declaration),
|
||||
makeItem(21, 9, Usage::Type::Declaration)};
|
||||
if (client()->versionNumber() < QVersionNumber(14))
|
||||
pureVirtualRefs << pureVirtualRefs.last();
|
||||
QTest::newRow("pure virtual declaration") << "defs.h" << 420 << pureVirtualRefs;
|
||||
|
||||
QTest::newRow("pointer variable") << "main.cpp" << 52 << ItemList{
|
||||
makeItem(6, 10, Usage::Type::Initialization), makeItem(8, 4, Usage::Type::Write),
|
||||
|
Reference in New Issue
Block a user