forked from qt-creator/qt-creator
ClangCodeModel: Bump minimum clangd version
We need clangd >= 14 to get rid of the cumbersome compile_commands.json creation. Change-Id: I30c19a385e2d76e478985f3df64968d1cb3efe87 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -636,7 +636,6 @@ static BaseClientInterface *clientInterface(Project *project, const Utils::FileP
|
|||||||
cmd.addArg("--compile-commands-dir=" + jsonDbDir.toString());
|
cmd.addArg("--compile-commands-dir=" + jsonDbDir.toString());
|
||||||
if (clangdLogServer().isDebugEnabled())
|
if (clangdLogServer().isDebugEnabled())
|
||||||
cmd.addArgs({"--log=verbose", "--pretty"});
|
cmd.addArgs({"--log=verbose", "--pretty"});
|
||||||
if (settings.clangdVersion() >= QVersionNumber(14))
|
|
||||||
cmd.addArg("--use-dirty-headers");
|
cmd.addArg("--use-dirty-headers");
|
||||||
const auto interface = new StdIOClientInterface;
|
const auto interface = new StdIOClientInterface;
|
||||||
interface->setCommandLine(cmd);
|
interface->setCommandLine(cmd);
|
||||||
@@ -3390,16 +3389,6 @@ IAssistProcessor *ClangdClient::ClangdCompletionAssistProvider::createProcessor(
|
|||||||
contextAnalyzer.positionEndOfExpression(),
|
contextAnalyzer.positionEndOfExpression(),
|
||||||
contextAnalyzer.completionOperator(),
|
contextAnalyzer.completionOperator(),
|
||||||
CustomAssistMode::Preprocessor);
|
CustomAssistMode::Preprocessor);
|
||||||
case ClangCompletionContextAnalyzer::CompleteIncludePath:
|
|
||||||
if (m_client->versionNumber() < QVersionNumber(14)) { // https://reviews.llvm.org/D112996
|
|
||||||
qCDebug(clangdLogCompletion) << "creating include processor";
|
|
||||||
return new CustomAssistProcessor(m_client,
|
|
||||||
contextAnalyzer.positionForProposal(),
|
|
||||||
contextAnalyzer.positionEndOfExpression(),
|
|
||||||
contextAnalyzer.completionOperator(),
|
|
||||||
CustomAssistMode::IncludePath);
|
|
||||||
}
|
|
||||||
[[fallthrough]];
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -238,8 +238,6 @@ void ClangdTestFindReferences::test_data()
|
|||||||
|
|
||||||
ItemList pureVirtualRefs{makeItem(17, 17, Usage::Type::Declaration),
|
ItemList pureVirtualRefs{makeItem(17, 17, Usage::Type::Declaration),
|
||||||
makeItem(21, 9, 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("pure virtual declaration") << "defs.h" << 420 << pureVirtualRefs;
|
||||||
|
|
||||||
QTest::newRow("pointer variable") << "main.cpp" << 52 << ItemList{
|
QTest::newRow("pointer variable") << "main.cpp" << 52 << ItemList{
|
||||||
@@ -400,8 +398,6 @@ void ClangdTestFollowSymbol::test()
|
|||||||
timer.stop();
|
timer.stop();
|
||||||
|
|
||||||
QCOMPARE(actualLink.targetFilePath, filePath(targetFile));
|
QCOMPARE(actualLink.targetFilePath, filePath(targetFile));
|
||||||
if (client()->versionNumber() < QVersionNumber(14))
|
|
||||||
QEXPECT_FAIL("union member ref", "https://github.com/clangd/clangd/issues/877", Abort);
|
|
||||||
QCOMPARE(actualLink.targetLine, targetLine);
|
QCOMPARE(actualLink.targetLine, targetLine);
|
||||||
QCOMPARE(actualLink.targetColumn + 1, targetColumn);
|
QCOMPARE(actualLink.targetColumn + 1, targetColumn);
|
||||||
}
|
}
|
||||||
@@ -627,11 +623,6 @@ void ClangdTestTooltips::test()
|
|||||||
QCOMPARE(editor->document(), doc);
|
QCOMPARE(editor->document(), doc);
|
||||||
QVERIFY(editor->editorWidget());
|
QVERIFY(editor->editorWidget());
|
||||||
|
|
||||||
if (client()->versionNumber() < QVersionNumber(14)
|
|
||||||
&& QLatin1String(QTest::currentDataTag()) == QLatin1String("IncludeDirective")) {
|
|
||||||
QSKIP("clangd <= 13 sends empty or no hover data for includes");
|
|
||||||
}
|
|
||||||
|
|
||||||
QTimer timer;
|
QTimer timer;
|
||||||
timer.setSingleShot(true);
|
timer.setSingleShot(true);
|
||||||
QEventLoop loop;
|
QEventLoop loop;
|
||||||
@@ -654,10 +645,8 @@ void ClangdTestTooltips::test()
|
|||||||
timer.stop();
|
timer.stop();
|
||||||
|
|
||||||
QEXPECT_FAIL("TypeName_ResolveTemplateTypeAlias", "typedef already resolved in AST", Abort);
|
QEXPECT_FAIL("TypeName_ResolveTemplateTypeAlias", "typedef already resolved in AST", Abort);
|
||||||
if (client()->versionNumber() >= QVersionNumber(14)) {
|
|
||||||
QEXPECT_FAIL("TypeNameIntroducedByUsingDeclarationQualified",
|
QEXPECT_FAIL("TypeNameIntroducedByUsingDeclarationQualified",
|
||||||
"https://github.com/clangd/clangd/issues/989", Abort);
|
"https://github.com/clangd/clangd/issues/989", Abort);
|
||||||
}
|
|
||||||
QCOMPARE(int(helpItem.category()), expectedCategory);
|
QCOMPARE(int(helpItem.category()), expectedCategory);
|
||||||
QEXPECT_FAIL("TemplateClassQualified", "Additional look-up needed?", Abort);
|
QEXPECT_FAIL("TemplateClassQualified", "Additional look-up needed?", Abort);
|
||||||
QCOMPARE(helpItem.helpIds(), expectedIds);
|
QCOMPARE(helpItem.helpIds(), expectedIds);
|
||||||
@@ -1376,11 +1365,6 @@ void ClangdTestHighlighting::test()
|
|||||||
};
|
};
|
||||||
const TextEditor::HighlightingResults results = findResults();
|
const TextEditor::HighlightingResults results = findResults();
|
||||||
|
|
||||||
if (client()->versionNumber() < QVersionNumber(14)) {
|
|
||||||
QEXPECT_FAIL("typedef as underlying type in enum declaration",
|
|
||||||
"https://github.com/clangd/clangd/issues/878",
|
|
||||||
Abort);
|
|
||||||
}
|
|
||||||
QEXPECT_FAIL("old-style signal (signal)", "check if and how we want to support this", Abort);
|
QEXPECT_FAIL("old-style signal (signal)", "check if and how we want to support this", Abort);
|
||||||
QEXPECT_FAIL("old-style signal (signal parameter)",
|
QEXPECT_FAIL("old-style signal (signal parameter)",
|
||||||
"check if and how we want to support this", Abort);
|
"check if and how we want to support this", Abort);
|
||||||
@@ -1417,17 +1401,6 @@ void ClangdTestHighlighting::test()
|
|||||||
actualStyles << s;
|
actualStyles << s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (client()->versionNumber() < QVersionNumber(14)) {
|
|
||||||
QEXPECT_FAIL("final virtual function call via pointer",
|
|
||||||
"clangd < 14 does not send virtual modifier", Continue);
|
|
||||||
QEXPECT_FAIL("virtual member function definition outside of class body",
|
|
||||||
"clangd < 14 does not send virtual modifier", Continue);
|
|
||||||
QEXPECT_FAIL("virtual function call via pointer",
|
|
||||||
"clangd < 14 does not send virtual modifier", Continue);
|
|
||||||
QEXPECT_FAIL("non-final virtual function call via pointer",
|
|
||||||
"clangd < 14 does not send virtual modifier", Continue);
|
|
||||||
}
|
|
||||||
QEXPECT_FAIL("non-const reference via member function call as output argument (object)",
|
QEXPECT_FAIL("non-const reference via member function call as output argument (object)",
|
||||||
"See below", Continue);
|
"See below", Continue);
|
||||||
QEXPECT_FAIL("non-const reference via member function call as output argument (function)",
|
QEXPECT_FAIL("non-const reference via member function call as output argument (function)",
|
||||||
@@ -1583,15 +1556,9 @@ void ClangdTestCompletion::testCompleteIncludeDirective()
|
|||||||
getProposal("includeDirectiveCompletion.cpp", proposal);
|
getProposal("includeDirectiveCompletion.cpp", proposal);
|
||||||
|
|
||||||
QVERIFY(proposal);
|
QVERIFY(proposal);
|
||||||
if (client()->versionNumber() < QVersionNumber(14)) {
|
|
||||||
QVERIFY(hasItem(proposal, "file.h"));
|
|
||||||
QVERIFY(hasItem(proposal, "otherFile.h"));
|
|
||||||
QVERIFY(hasItem(proposal, "mylib/"));
|
|
||||||
} else {
|
|
||||||
QVERIFY(hasItem(proposal, " file.h>"));
|
QVERIFY(hasItem(proposal, " file.h>"));
|
||||||
QVERIFY(hasItem(proposal, " otherFile.h>"));
|
QVERIFY(hasItem(proposal, " otherFile.h>"));
|
||||||
QVERIFY(hasItem(proposal, " mylib/"));
|
QVERIFY(hasItem(proposal, " mylib/"));
|
||||||
}
|
|
||||||
QVERIFY(!hasSnippet(proposal, "class "));
|
QVERIFY(!hasSnippet(proposal, "class "));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1889,10 +1856,6 @@ void ClangdTestCompletion::testSignalCompletion()
|
|||||||
getProposal("signalCompletion.cpp", proposal, customCode);
|
getProposal("signalCompletion.cpp", proposal, customCode);
|
||||||
|
|
||||||
QVERIFY(proposal);
|
QVERIFY(proposal);
|
||||||
if (client()->versionNumber() < QVersionNumber(14)
|
|
||||||
&& QString::fromLatin1(QTest::currentDataTag()).startsWith("positive:")) {
|
|
||||||
QEXPECT_FAIL("", "Signal info in completions requires clangd >= 14", Abort);
|
|
||||||
}
|
|
||||||
QCOMPARE(proposal->size(), expectedSuggestions.size());
|
QCOMPARE(proposal->size(), expectedSuggestions.size());
|
||||||
for (const QString &expectedSuggestion : qAsConst(expectedSuggestions))
|
for (const QString &expectedSuggestion : qAsConst(expectedSuggestions))
|
||||||
QVERIFY2(hasItem(proposal, ' ' + expectedSuggestion), qPrintable(expectedSuggestion));
|
QVERIFY2(hasItem(proposal, ' ' + expectedSuggestion), qPrintable(expectedSuggestion));
|
||||||
|
@@ -337,7 +337,7 @@ ClangdSettings::ClangdSettings()
|
|||||||
|
|
||||||
bool ClangdSettings::useClangd() const
|
bool ClangdSettings::useClangd() const
|
||||||
{
|
{
|
||||||
return m_data.useClangd && clangdVersion() >= QVersionNumber(13);
|
return m_data.useClangd && clangdVersion() >= QVersionNumber(14);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClangdSettings::setDefaultClangdPath(const FilePath &filePath)
|
void ClangdSettings::setDefaultClangdPath(const FilePath &filePath)
|
||||||
|
@@ -381,9 +381,9 @@ ClangdSettingsWidget::ClangdSettingsWidget(const ClangdSettings::Data &settingsD
|
|||||||
"Unexpected clangd output."));
|
"Unexpected clangd output."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (clangdVersion < QVersionNumber(13)) {
|
if (clangdVersion < QVersionNumber(14)) {
|
||||||
labelSetter.setWarning(tr("The clangd version is %1, but %2 or greater is required.")
|
labelSetter.setWarning(tr("The clangd version is %1, but %2 or greater is required.")
|
||||||
.arg(clangdVersion.toString()).arg(13));
|
.arg(clangdVersion.toString()).arg(14));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user