ClangCodeModel: Prevent indexing with fallback client

There is no project to index.

Change-Id: I6d3ad2f894a45e2a7934cfb3c10c525299bfd34b
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2021-10-29 16:46:34 +02:00
parent 4fe5be2565
commit 6e5ec9a939

View File

@@ -560,7 +560,7 @@ static BaseClientInterface *clientInterface(Project *project, const Utils::FileP
{
QString indexingOption = "--background-index";
const CppEditor::ClangdSettings settings(CppEditor::ClangdProjectSettings(project).settings());
if (!settings.indexingEnabled())
if (!settings.indexingEnabled() || jsonDbDir.isEmpty())
indexingOption += "=0";
const QString headerInsertionOption = QString("--header-insertion=")
+ (settings.autoIncludeHeaders() ? "iwyu" : "never");