diff --git a/src/plugins/clangcodemodel/clangdsemantichighlighting.cpp b/src/plugins/clangcodemodel/clangdsemantichighlighting.cpp index f93d8302bd3..378e0f9346f 100644 --- a/src/plugins/clangcodemodel/clangdsemantichighlighting.cpp +++ b/src/plugins/clangcodemodel/clangdsemantichighlighting.cpp @@ -326,8 +326,10 @@ void doSemanticHighlighting( styles.mainStyle = C_PARAMETER; } else if (token.type == "macro") { styles.mainStyle = C_MACRO; - } else if (token.type == "type" || token.type == "concept") { + } else if (token.type == "type") { styles.mainStyle = C_TYPE; + } else if (token.type == "concept") { + styles.mainStyle = C_CONCEPT; } else if (token.type == "modifier") { styles.mainStyle = C_KEYWORD; } else if (token.type == "label") { diff --git a/src/plugins/clangcodemodel/test/clangdtests.cpp b/src/plugins/clangcodemodel/test/clangdtests.cpp index a102f1d3527..5a52a207853 100644 --- a/src/plugins/clangcodemodel/test/clangdtests.cpp +++ b/src/plugins/clangcodemodel/test/clangdtests.cpp @@ -1302,8 +1302,8 @@ void ClangdTestHighlighting::test_data() QTest::newRow("fake operator method call") << 1050 << 8 << 1050 << 22 << QList{C_FUNCTION} << 0; QTest::newRow("concept definition") << 1053 << 30 << 1053 << 42 - << QList{C_TYPE, C_DECLARATION} << 0; - QTest::newRow("concept use") << 1054 << 29 << 1054 << 41 << QList{C_TYPE} << 0; + << QList{C_CONCEPT, C_DECLARATION} << 0; + QTest::newRow("concept use") << 1054 << 29 << 1054 << 41 << QList{C_CONCEPT} << 0; QTest::newRow("label declaration") << 242 << 1 << 242 << 11 << QList{C_LABEL, C_DECLARATION} << 0; QTest::newRow("label use") << 244 << 10 << 244 << 20 << QList{C_LABEL} << 0; diff --git a/src/plugins/texteditor/fontsettings.cpp b/src/plugins/texteditor/fontsettings.cpp index d5f2ddc6666..873be0ae78a 100644 --- a/src/plugins/texteditor/fontsettings.cpp +++ b/src/plugins/texteditor/fontsettings.cpp @@ -420,8 +420,8 @@ bool FontSettings::loadColorScheme(const Utils::FilePath &filePath, for (const FormatDescription &desc : descriptions) { const TextStyle id = desc.id(); if (!m_scheme.contains(id)) { - if (id == C_NAMESPACE && m_scheme.contains(C_TYPE)) { - m_scheme.setFormatFor(C_NAMESPACE, m_scheme.formatFor(C_TYPE)); + if ((id == C_NAMESPACE || id == C_CONCEPT) && m_scheme.contains(C_TYPE)) { + m_scheme.setFormatFor(id, m_scheme.formatFor(C_TYPE)); continue; } if (id == C_MACRO && m_scheme.contains(C_FUNCTION)) { diff --git a/src/plugins/texteditor/texteditorconstants.cpp b/src/plugins/texteditor/texteditorconstants.cpp index fbf248be009..e6d157adca9 100644 --- a/src/plugins/texteditor/texteditorconstants.cpp +++ b/src/plugins/texteditor/texteditorconstants.cpp @@ -33,6 +33,7 @@ const char *nameForStyle(TextStyle style) case C_NUMBER: return "Number"; case C_STRING: return "String"; case C_TYPE: return "Type"; + case C_CONCEPT: return "Concept"; case C_NAMESPACE: return "Namespace"; case C_LOCAL: return "Local"; case C_PARAMETER: return "Parameter"; diff --git a/src/plugins/texteditor/texteditorconstants.h b/src/plugins/texteditor/texteditorconstants.h index f422630f0d2..946b2b2f890 100644 --- a/src/plugins/texteditor/texteditorconstants.h +++ b/src/plugins/texteditor/texteditorconstants.h @@ -33,6 +33,7 @@ enum TextStyle : quint8 { C_NUMBER, C_STRING, C_TYPE, + C_CONCEPT, C_NAMESPACE, C_LOCAL, C_PARAMETER, diff --git a/src/plugins/texteditor/texteditorsettings.cpp b/src/plugins/texteditor/texteditorsettings.cpp index 8f6bab2c5f3..5e99fcf582f 100644 --- a/src/plugins/texteditor/texteditorsettings.cpp +++ b/src/plugins/texteditor/texteditorsettings.cpp @@ -141,6 +141,8 @@ FormatDescriptions TextEditorSettingsPrivate::initialFormats() Tr::tr("Name of a primitive data type."), Qt::darkYellow); formatDescr.emplace_back(C_TYPE, Tr::tr("Type"), Tr::tr("Name of a type."), Qt::darkMagenta); + formatDescr.emplace_back(C_CONCEPT, Tr::tr("Concept"), Tr::tr("Name of a concept."), + Qt::darkMagenta); formatDescr.emplace_back(C_NAMESPACE, Tr::tr("Namespace"), Tr::tr("Name of a namespace."), Qt::darkGreen); formatDescr.emplace_back(C_LOCAL, Tr::tr("Local"),