forked from qt-creator/qt-creator
ClangCodeModel: Support new clangd semantic token for labels
See https://reviews.llvm.org/D143260. Task-number: QTCREATORBUG-27338 Change-Id: I26eb3688f311d93c966901a6639931fec944dd49 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -330,6 +330,8 @@ void doSemanticHighlighting(
|
||||
styles.mainStyle = C_TYPE;
|
||||
} else if (token.type == "modifier") {
|
||||
styles.mainStyle = C_KEYWORD;
|
||||
} else if (token.type == "label") {
|
||||
styles.mainStyle = C_LABEL;
|
||||
} 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.
|
||||
|
||||
@@ -1302,6 +1302,9 @@ void ClangdTestHighlighting::test_data()
|
||||
QTest::newRow("concept definition") << 1053 << 30 << 1053 << 42
|
||||
<< QList<int>{C_TYPE, C_DECLARATION} << 0;
|
||||
QTest::newRow("concept use") << 1054 << 29 << 1054 << 41 << QList<int>{C_TYPE} << 0;
|
||||
QTest::newRow("label declaration") << 242 << 1 << 242 << 11
|
||||
<< QList<int>{C_LABEL, C_DECLARATION} << 0;
|
||||
QTest::newRow("label use") << 244 << 10 << 244 << 20 << QList<int>{C_LABEL} << 0;
|
||||
}
|
||||
|
||||
void ClangdTestHighlighting::test()
|
||||
|
||||
Reference in New Issue
Block a user