ClangCodeModel: Add XFAIL-ing test for clangd completion

Change-Id: Ic8672d5ce14b9a8d86dc511c5aa3289037258d64
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2021-09-17 16:26:38 +02:00
parent 728be60986
commit 002d0a97aa
5 changed files with 22 additions and 1 deletions

View File

@@ -1431,7 +1431,8 @@ ClangdTestCompletion::ClangdTestCompletion()
"membercompletion-inside.cpp", "membercompletion-outside.cpp", "membercompletion-inside.cpp", "membercompletion-outside.cpp",
"noDotToArrowCorrectionForFloats.cpp", "noDotToArrowCorrectionForFloats.cpp",
"preprocessorKeywordsCompletion.cpp", "preprocessorKeywordsCompletion2.cpp", "preprocessorKeywordsCompletion.cpp", "preprocessorKeywordsCompletion2.cpp",
"preprocessorKeywordsCompletion3.cpp", "signalCompletion.cpp"}); "preprocessorKeywordsCompletion3.cpp", "privateFuncDefCompletion.cpp",
"signalCompletion.cpp"});
} }
void ClangdTestCompletion::initTestCase() void ClangdTestCompletion::initTestCase()
@@ -1664,6 +1665,18 @@ void ClangdTestCompletion::testCompleteClassAndConstructor()
QCOMPARE(manipulator.skipPos(), -1); QCOMPARE(manipulator.skipPos(), -1);
} }
void ClangdTestCompletion::testCompletePrivateFunctionDefinition()
{
ProposalModelPtr proposal;
getProposal("privateFuncDefCompletion.cpp", proposal);
QVERIFY(proposal);
QEXPECT_FAIL("", "FIXME: clangd needs to differentiate "
"between function call and function definiton", Abort);
QCOMPARE(proposal->size(), 1);
QVERIFY(hasItem(proposal, " theFunc()"));
}
void ClangdTestCompletion::testCompleteWithDotToArrowCorrection() void ClangdTestCompletion::testCompleteWithDotToArrowCorrection()
{ {
ProposalModelPtr proposal; ProposalModelPtr proposal;

View File

@@ -169,6 +169,7 @@ private slots:
void testFunctionHintsFiltered(); void testFunctionHintsFiltered();
void testFunctionHintConstructor(); void testFunctionHintConstructor();
void testCompleteClassAndConstructor(); void testCompleteClassAndConstructor();
void testCompletePrivateFunctionDefinition();
void testCompleteWithDotToArrowCorrection(); void testCompleteWithDotToArrowCorrection();
void testDontCompleteWithDotToArrowCorrectionForFloats(); void testDontCompleteWithDotToArrowCorrectionForFloats();

View File

@@ -53,5 +53,6 @@
<file>completion/functionAddress.cpp</file> <file>completion/functionAddress.cpp</file>
<file>completion/preprocessorKeywordsCompletion2.cpp</file> <file>completion/preprocessorKeywordsCompletion2.cpp</file>
<file>completion/preprocessorKeywordsCompletion3.cpp</file> <file>completion/preprocessorKeywordsCompletion3.cpp</file>
<file>completion/privateFuncDefCompletion.cpp</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@@ -24,6 +24,7 @@ SOURCES = \
preprocessorKeywordsCompletion.cpp \ preprocessorKeywordsCompletion.cpp \
preprocessorKeywordsCompletion2.cpp \ preprocessorKeywordsCompletion2.cpp \
preprocessorKeywordsCompletion3.cpp \ preprocessorKeywordsCompletion3.cpp \
privateFuncDefCompletion.cpp \
signalCompletion.cpp signalCompletion.cpp
HEADERS = mainwindow.h HEADERS = mainwindow.h

View File

@@ -0,0 +1,5 @@
class MyClass {
void theFunc();
};
void MyClass::the /* COMPLETE HERE */