forked from qt-creator/qt-creator
ClangCodeModel: Adapt to new highlighting modifier in clangd
See https://reviews.llvm.org/D134728. Change-Id: I2bcfb09736b6eabc54cd986b0c096c8fa5869b8e 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:
@@ -289,10 +289,9 @@ void doSemanticHighlighting(
|
|||||||
}
|
}
|
||||||
} else if (token.type == "class") {
|
} else if (token.type == "class") {
|
||||||
styles.mainStyle = C_TYPE;
|
styles.mainStyle = C_TYPE;
|
||||||
|
if (token.modifiers.contains("constructorOrDestructor")) {
|
||||||
// clang hardly ever differentiates between constructors and the associated class,
|
styles.mainStyle = C_FUNCTION;
|
||||||
// whereas we highlight constructors as functions.
|
} else if (ver < 16 && ast.isValid()) {
|
||||||
if (ast.isValid()) {
|
|
||||||
const ClangdAstPath path = getAstPath(ast, tokenRange(token));
|
const ClangdAstPath path = getAstPath(ast, tokenRange(token));
|
||||||
if (!path.isEmpty()) {
|
if (!path.isEmpty()) {
|
||||||
if (path.last().kind() == "CXXConstructor") {
|
if (path.last().kind() == "CXXConstructor") {
|
||||||
|
Reference in New Issue
Block a user