forked from qt-creator/qt-creator
ClangCodeModel: Show only valid applicable overloads when completing
libclang is smart enough to filter the overloads according to which arguments have already been entered, so let's make use of that. Fixes: QTCREATORBUG-650 Change-Id: Ic2711f460c908c6fd9c8efe28c3c63a0ce2d9205 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
committed by
Christian Stenger
parent
9c9ca280ea
commit
dfa24f09ad
@@ -608,6 +608,18 @@ void ClangCodeCompletionTest::testCompleteFunctions()
|
||||
QVERIFY(hasItem(t.proposal, "TType<QString> f(bool)"));
|
||||
}
|
||||
|
||||
void ClangCodeCompletionTest::testCompleteOverloads()
|
||||
{
|
||||
ProjectLessCompletionTest t("functionCompletionFiltered.cpp");
|
||||
QCOMPARE(t.proposal->size(), 1);
|
||||
QVERIFY(hasItem(t.proposal, "void func(int i, int j)"));
|
||||
|
||||
ProjectLessCompletionTest t2("functionCompletionFiltered2.cpp");
|
||||
QCOMPARE(t2.proposal->size(), 2);
|
||||
QVERIFY(hasItem(t2.proposal, "void func(const S &s, int j)"));
|
||||
QVERIFY(hasItem(t2.proposal, "void func(const S &s, int j, int k)"));
|
||||
}
|
||||
|
||||
void ClangCodeCompletionTest::testCompleteConstructor()
|
||||
{
|
||||
ProjectLessCompletionTest t("constructorCompletion.cpp");
|
||||
|
||||
Reference in New Issue
Block a user