forked from qt-creator/qt-creator
clangd: use QTC_CLANGD_COMPLETION_RESULTS as default value
If the user set the QTC_CLANGD_COMPLETION_RESULTS environment variable, use that value as the default value for the settings page widget value. Change-Id: I525e8bb4a5631b7d8461f18d1fc5c6972bd758cb Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -508,7 +508,15 @@ void ClangdSettings::Data::fromMap(const QVariantMap &map)
|
||||
diagnosticConfigId = Id::fromSetting(map.value(diagnosticConfigIdKey(),
|
||||
initialClangDiagnosticConfigId().toSetting()));
|
||||
haveCheckedHardwareReqirements = map.value(checkedHardwareKey(), false).toBool();
|
||||
completionResults = map.value(completionResultsKey(), kDefaultCompletionResults).toInt();
|
||||
completionResults = map.value(completionResultsKey(), defaultCompletionResults()).toInt();
|
||||
}
|
||||
|
||||
int ClangdSettings::Data::defaultCompletionResults()
|
||||
{
|
||||
// Default clangd --limit-results value is 100
|
||||
bool ok = false;
|
||||
const int userValue = qEnvironmentVariableIntValue("QTC_CLANGD_COMPLETION_RESULTS", &ok);
|
||||
return ok ? userValue : 100;
|
||||
}
|
||||
|
||||
} // namespace CppEditor
|
||||
|
||||
Reference in New Issue
Block a user