forked from qt-creator/qt-creator
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:
@@ -331,6 +331,8 @@ void doSemanticHighlighting(
|
|||||||
styles.mainStyle = C_MACRO;
|
styles.mainStyle = C_MACRO;
|
||||||
} else if (token.type == "type") {
|
} else if (token.type == "type") {
|
||||||
styles.mainStyle = C_TYPE;
|
styles.mainStyle = C_TYPE;
|
||||||
|
} else if (token.type == "modifier") {
|
||||||
|
styles.mainStyle = C_KEYWORD;
|
||||||
} else if (token.type == "typeParameter") {
|
} else if (token.type == "typeParameter") {
|
||||||
// clangd reports both type and non-type template parameters as type parameters,
|
// clangd reports both type and non-type template parameters as type parameters,
|
||||||
// but the latter can be distinguished by the readonly modifier.
|
// 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);
|
insertResult(node, C_PRIMITIVE_TYPE);
|
||||||
return;
|
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);
|
insertResult(node, C_KEYWORD);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user