ClangCodeModel: Make use of new clangd token type "modifier"

See https://reviews.llvm.org/D137943.

Change-Id: I313576b32fff1c9ba44e3753e3f02cdd34e2ea3e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2022-11-14 15:12:48 +01:00
parent 7e9cab6e78
commit 918c7ca52d

View File

@@ -331,6 +331,8 @@ void doSemanticHighlighting(
styles.mainStyle = C_MACRO;
} else if (token.type == "type") {
styles.mainStyle = C_TYPE;
} else if (token.type == "modifier") {
styles.mainStyle = C_KEYWORD;
} 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.
@@ -578,7 +580,8 @@ void ExtraHighlightingResultsCollector::collectFromNode(const ClangdAstNode &nod
insertResult(node, C_PRIMITIVE_TYPE);
return;
}
if (node.role() == "attribute" && (node.kind() == "Override" || node.kind() == "Final")) {
if (m_clangdVersion < 16 && node.role() == "attribute"
&& (node.kind() == "Override" || node.kind() == "Final")) {
insertResult(node, C_KEYWORD);
return;
}