ClangCodeModel: Fix access type categorization for functions

... with clangd.
The code is starting to look rather hacky and might need to be rewritten
completely at some point. Let's see how far we get with it.

Change-Id: I506dd410831970b9f9291b005129b4d70f397de0
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2021-12-09 17:59:10 +01:00
parent 3989245562
commit fc3b7f7ac5
3 changed files with 27 additions and 4 deletions

View File

@@ -284,6 +284,11 @@ void ClangdTestFindReferences::test_data()
QTest::newRow("array variable") << "main.cpp" << 1134 << ItemList{
makeItem(57, 8, Usage::Type::Declaration), makeItem(58, 4, Usage::Type::Write),
makeItem(59, 15, Usage::Type::Read)};
QTest::newRow("free function") << "defs.h" << 510 << ItemList{
makeItem(24, 5, Usage::Type::Declaration), makeItem(19, 4, Usage::Type::Other),
makeItem(25, 4, Usage::Type::Other), makeItem(60, 26, Usage::Type::Read)};
QTest::newRow("member function") << "defs.h" << 192 << ItemList{
makeItem(9, 12, Usage::Type::Declaration), makeItem(40, 8, Usage::Type::Other)};
}
// The main point here is to test our access type categorization.