Merge remote-tracking branch 'origin/6.0'

Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/clangcodemodel/clangdclient.cpp

Change-Id: I75c954d2e573d65089205d2542747bba3276be2a
This commit is contained in:
Eike Ziller
2022-01-03 14:14:12 +01:00
21 changed files with 159 additions and 76 deletions

View File

@@ -2597,7 +2597,7 @@ static void semanticHighlighter(QFutureInterface<HighlightingResult> &future,
return Range(startPos, endPos);
};
const auto isOutputParameter = [&ast, &tokenRange](const ExpandedSemanticToken &token) {
if (token.modifiers.contains("usedAsMutableReference"))
if (token.modifiers.contains(QLatin1String("usedAsMutableReference")))
return true;
if (token.type != "variable" && token.type != "property" && token.type != "parameter")
return false;
@@ -2649,16 +2649,17 @@ static void semanticHighlighter(QFutureInterface<HighlightingResult> &future,
(const ExpandedSemanticToken &token) {
TextStyles styles;
if (token.type == "variable") {
if (token.modifiers.contains("functionScope")) {
if (token.modifiers.contains(QLatin1String("functionScope"))) {
styles.mainStyle = C_LOCAL;
} else if (token.modifiers.contains("classScope")) {
} else if (token.modifiers.contains(QLatin1String("classScope"))) {
styles.mainStyle = C_FIELD;
} else if (token.modifiers.contains("fileScope")
|| token.modifiers.contains("globalScope")) {
} else if (token.modifiers.contains(QLatin1String("fileScope"))
|| token.modifiers.contains(QLatin1String("globalScope"))) {
styles.mainStyle = C_GLOBAL;
}
} else if (token.type == "function" || token.type == "method") {
styles.mainStyle = token.modifiers.contains("virtual") ? C_VIRTUAL_METHOD : C_FUNCTION;
styles.mainStyle = token.modifiers.contains(QLatin1String("virtual"))
? C_VIRTUAL_METHOD : C_FUNCTION;
if (ast.isValid()) {
const QList<AstNode> path = getAstPath(ast, tokenRange(token));
if (path.length() > 1) {
@@ -2716,11 +2717,12 @@ static void semanticHighlighter(QFutureInterface<HighlightingResult> &future,
} else if (token.type == "typeParameter") {
// clangd reports both type and non-type template parameters as type parameters,
// but the latter can be distinguished by the readonly modifier.
styles.mainStyle = token.modifiers.contains("readonly") ? C_PARAMETER : C_TYPE;
styles.mainStyle = token.modifiers.contains(QLatin1String("readonly"))
? C_PARAMETER : C_TYPE;
}
if (token.modifiers.contains("declaration"))
if (token.modifiers.contains(QLatin1String("declaration")))
styles.mixinStyles.push_back(C_DECLARATION);
if (token.modifiers.contains("static"))
if (token.modifiers.contains(QLatin1String("static")))
styles.mixinStyles.push_back(C_STATIC_MEMBER);
if (isOutputParameter(token))
styles.mixinStyles.push_back(C_OUTPUT_ARGUMENT);