diff --git a/src/plugins/clangcodemodel/clangdclient.cpp b/src/plugins/clangcodemodel/clangdclient.cpp index 9e828900a7c..228126ef215 100644 --- a/src/plugins/clangcodemodel/clangdclient.cpp +++ b/src/plugins/clangcodemodel/clangdclient.cpp @@ -82,6 +82,7 @@ #include #include #include +#include #include #include #include @@ -275,7 +276,8 @@ static BaseClientInterface *clientInterface(Project *project, const Utils::FileP + (settings.autoIncludeHeaders() ? "iwyu" : "never"); bool ok = false; - const int userValue = qEnvironmentVariableIntValue("QTC_CLANGD_COMPLETION_RESULTS", &ok); + const int userValue + = Utils::Environment::systemEnvironment().value("QTC_CLANGD_COMPLETION_RESULTS").toInt(&ok); const QString limitResults = QString("--limit-results=%1").arg(ok ? userValue : 0); Utils::CommandLine cmd{settings.clangdFilePath(), {indexingOption, headerInsertionOption,