Clang: Fallback to global completion if function call completion fails

We can not offer proper constructor completion with libclang <= 3.6, so
fall back to normal/global completion.

Change-Id: I90bb8d981ae20ed4c228f829ad4267221b92f8a1
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
This commit is contained in:
Nikolai Kosjar
2015-07-22 13:09:44 +02:00
parent 889237f962
commit 5643a45a83
7 changed files with 40 additions and 9 deletions

View File

@@ -874,6 +874,15 @@ void ClangCodeCompletionTest::testCompleteFunctions()
QVERIFY(hasItem(t.proposal, "TType<QString> f(bool)"));
}
void ClangCodeCompletionTest::testCompleteConstructorAndFallbackToGlobalCompletion()
{
ProjectLessCompletionTest t("constructorCompletion.cpp");
QVERIFY(hasItem(t.proposal, "globalVariable"));
QVERIFY(hasItem(t.proposal, "GlobalClassWithCustomConstructor"));
QVERIFY(!hasSnippet(t.proposal, "class"));
}
void ClangCodeCompletionTest::testProjectDependentCompletion()
{
const TestDocument testDocument("completionWithProject.cpp");