ClangCodeModel: Remove fallback code for clangd < 13

Amends 4dfdbf91f6.

Change-Id: Ie8657329380e83aeb76503e360afa5ebf0e60fbb
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2022-02-14 09:25:29 +01:00
parent dfd3f81084
commit e5f8fe311d
3 changed files with 2 additions and 13 deletions

View File

@@ -1708,8 +1708,7 @@ void ClangdClient::Private::handleFindUsagesResult(quint64 key, const QList<Loca
} }
qCDebug(clangdLog) << "document count is" << refData->fileData.size(); qCDebug(clangdLog) << "document count is" << refData->fileData.size();
if (refData->replacementData || q->versionNumber() < QVersionNumber(13) if (refData->replacementData || !refData->categorize) {
|| !refData->categorize) {
qCDebug(clangdLog) << "skipping AST retrieval"; qCDebug(clangdLog) << "skipping AST retrieval";
reportAllSearchResultsAndFinish(*refData); reportAllSearchResultsAndFinish(*refData);
return; return;
@@ -1879,11 +1878,6 @@ void ClangdClient::followSymbol(TextDocument *document,
}; };
symbolSupport().findLinkAt(document, adjustedCursor, std::move(gotoDefCallback), true); symbolSupport().findLinkAt(document, adjustedCursor, std::move(gotoDefCallback), true);
if (versionNumber() < QVersionNumber(12)) {
d->followSymbolData->cursorNode.emplace(AstNode());
return;
}
const auto astHandler = [this, id = d->followSymbolData->id] const auto astHandler = [this, id = d->followSymbolData->id]
(const AstNode &ast, const MessageId &) { (const AstNode &ast, const MessageId &) {
qCDebug(clangdLog) << "received ast response for cursor"; qCDebug(clangdLog) << "received ast response for cursor";

View File

@@ -260,7 +260,7 @@ void ClangFollowSymbol::switchDeclDef(const CppEditor::CursorInEditor &data,
{ {
ClangdClient * const client ClangdClient * const client
= ClangModelManagerSupport::instance()->clientForFile(data.filePath()); = ClangModelManagerSupport::instance()->clientForFile(data.filePath());
if (client && client->isFullyIndexed() && client->versionNumber() >= QVersionNumber(13)) { if (client && client->isFullyIndexed()) {
client->switchDeclDef(data.textDocument(), data.cursor(), data.editorWidget(), client->switchDeclDef(data.textDocument(), data.cursor(), data.editorWidget(),
std::move(processLinkCallback)); std::move(processLinkCallback));
return; return;

View File

@@ -179,7 +179,6 @@ ClangdTestFindReferences::ClangdTestFindReferences()
{ {
setProjectFileName("find-usages.pro"); setProjectFileName("find-usages.pro");
setSourceFileNames({"defs.h", "main.cpp"}); setSourceFileNames({"defs.h", "main.cpp"});
setMinimumVersion(13);
} }
void ClangdTestFindReferences::initTestCase() void ClangdTestFindReferences::initTestCase()
@@ -322,7 +321,6 @@ ClangdTestFollowSymbol::ClangdTestFollowSymbol()
{ {
setProjectFileName("follow-symbol.pro"); setProjectFileName("follow-symbol.pro");
setSourceFileNames({"main.cpp", "header.h"}); setSourceFileNames({"main.cpp", "header.h"});
setMinimumVersion(12);
} }
void ClangdTestFollowSymbol::test_data() void ClangdTestFollowSymbol::test_data()
@@ -409,7 +407,6 @@ ClangdTestLocalReferences::ClangdTestLocalReferences()
{ {
setProjectFileName("local-references.pro"); setProjectFileName("local-references.pro");
setSourceFileNames({"references.cpp"}); setSourceFileNames({"references.cpp"});
setMinimumVersion(13);
} }
// We currently only support local variables, but if and when clangd implements // We currently only support local variables, but if and when clangd implements
@@ -525,7 +522,6 @@ ClangdTestTooltips::ClangdTestTooltips()
{ {
setProjectFileName("tooltips.pro"); setProjectFileName("tooltips.pro");
setSourceFileNames({"tooltips.cpp"}); setSourceFileNames({"tooltips.cpp"});
setMinimumVersion(13);
} }
void ClangdTestTooltips::test_data() void ClangdTestTooltips::test_data()
@@ -668,7 +664,6 @@ ClangdTestHighlighting::ClangdTestHighlighting()
{ {
setProjectFileName("highlighting.pro"); setProjectFileName("highlighting.pro");
setSourceFileNames({"highlighting.cpp"}); setSourceFileNames({"highlighting.cpp"});
setMinimumVersion(13);
} }
void ClangdTestHighlighting::initTestCase() void ClangdTestHighlighting::initTestCase()