forked from qt-creator/qt-creator
ClangCodeModel: Ignore built-in types
... in the semantic highlighter. The syntax highlighter already handles these. Change-Id: Ib1e80ec194021dbd2b4eca7a300db869ccddb7b0 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:
@@ -596,11 +596,8 @@ void ExtraHighlightingResultsCollector::collectFromNode(const ClangdAstNode &nod
|
||||
{
|
||||
if (node.kind().endsWith("Literal"))
|
||||
return;
|
||||
|
||||
if (node.role() == "type" && node.kind() == "Builtin") {
|
||||
insertResult(node, C_PRIMITIVE_TYPE);
|
||||
if (node.role() == "type" && node.kind() == "Builtin")
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_clangdVersion < 16 && node.role() == "attribute"
|
||||
&& (node.kind() == "Override" || node.kind() == "Final")) {
|
||||
|
@@ -712,8 +712,6 @@ void ClangdTestHighlighting::test_data()
|
||||
QTest::newRow("function call") << 64 << 5 << 64 << 13 << QList<int>{C_FUNCTION} << 0;
|
||||
QTest::newRow("type conversion function (struct)") << 68 << 14 << 68 << 17
|
||||
<< QList<int>{C_TYPE} << 0;
|
||||
QTest::newRow("type conversion function (built-in)") << 69 << 14 << 69 << 17
|
||||
<< QList<int>{C_PRIMITIVE_TYPE} << 0;
|
||||
QTest::newRow("type reference") << 74 << 5 << 74 << 8 << QList<int>{C_TYPE} << 0;
|
||||
QTest::newRow("local variable declaration") << 79 << 9 << 79 << 12
|
||||
<< QList<int>{C_LOCAL, C_DECLARATION} << 0;
|
||||
|
@@ -510,6 +510,9 @@ void CppHighlighterTest::test_data()
|
||||
QTest::newRow("integer literal as non-type template parameter default value")
|
||||
<< 23 << 18 << 23 << 18 << C_NUMBER;
|
||||
QTest::newRow("class keyword") << 23 << 21 << 23 << 25 << C_KEYWORD;
|
||||
QTest::newRow("struct keyword") << 25 << 1 << 25 << 6 << C_KEYWORD;
|
||||
QTest::newRow("operator keyword") << 26 << 5 << 26 << 12 << C_KEYWORD;
|
||||
QTest::newRow("type in conversion operator") << 26 << 14 << 26 << 16 << C_PRIMITIVE_TYPE;
|
||||
}
|
||||
|
||||
void CppHighlighterTest::test()
|
||||
|
@@ -21,3 +21,7 @@ void numberLiterals()
|
||||
}
|
||||
|
||||
template<int n = 5> class C;
|
||||
|
||||
struct ConversionFunction {
|
||||
operator int();
|
||||
};
|
||||
|
Reference in New Issue
Block a user