MCPcopy Create free account
hub / github.com/KDE/kdevelop / testArgumentHintCompletion

Method testArgumentHintCompletion

plugins/clang/tests/test_codecompletion.cpp:1431–1455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1429}
1430
1431void TestCodeCompletion::testArgumentHintCompletion()
1432{
1433 QFETCH(QString, code);
1434 QFETCH(CompletionItems, expectedItems);
1435 QFETCH(HintItemList, hints);
1436
1437 executeCompletionTest(code, expectedItems, NoMacroOrBuiltin, [&](const ClangCodeCompletionItemTester& tester) {
1438 DUChainReadLocker lock;
1439 HintItemList actualHints;
1440 for (const auto& item : tester.items) {
1441 if (item->argumentHintDepth() == 1) {
1442 actualHints << HintItem{
1443 tester.itemData(item).toString() + tester.itemData(item, KTextEditor:: CodeCompletionModel::Arguments).toString(),
1444 item->declaration()
1445 };
1446 }
1447 }
1448 std::sort(hints.begin(), hints.end());
1449 std::sort(actualHints.begin(), actualHints.end());
1450 QEXPECT_FAIL("member function", "clang_getCompletionParent returns nothing, thus decl lookup fails", Continue);
1451 QEXPECT_FAIL("namespaced function", "clang_getCompletionParent returns nothing, thus decl lookup fails", Continue);
1452 QEXPECT_FAIL("namespaced constructor", "clang_getCompletionParent returns nothing, thus decl lookup fails", Continue);
1453 QCOMPARE(actualHints, hints);
1454 });
1455}
1456
1457void TestCodeCompletion::testArgumentHintCompletion_data()
1458{

Callers

nothing calls this directly

Calls 8

executeCompletionTestFunction · 0.85
sortFunction · 0.85
argumentHintDepthMethod · 0.45
toStringMethod · 0.45
itemDataMethod · 0.45
declarationMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected