forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/3.0'
Conflicts: qtcreator.pri qtcreator.qbs Change-Id: I0485b1bf75cc02f9fbcb5c05e350da91f491abe3
This commit is contained in:
@@ -2821,3 +2821,46 @@ void CppToolsPlugin::test_completion_signals_hide_QPrivateSignal()
|
||||
QCOMPARE(completions.size(), 1);
|
||||
QVERIFY(completions.contains(QLatin1String("timeout()")));
|
||||
}
|
||||
|
||||
void CppToolsPlugin::test_completion_member_of_class_accessed_by_using_QTCREATORBUG9037_1()
|
||||
{
|
||||
const QByteArray source =
|
||||
"namespace NS { struct S { int member; void fun(); }; }\n"
|
||||
"using NS::S;\n"
|
||||
"void S::fun()\n"
|
||||
"{\n"
|
||||
" @\n"
|
||||
" // padding so we get the scope right\n"
|
||||
"}\n"
|
||||
;
|
||||
CompletionTestCase test(source, "mem");
|
||||
|
||||
QStringList completions = test.getCompletions();
|
||||
QCOMPARE(completions.size(), 1);
|
||||
QVERIFY(completions.contains(QLatin1String("member")));
|
||||
}
|
||||
|
||||
void CppToolsPlugin::test_completion_member_of_class_accessed_by_using_QTCREATORBUG9037_2()
|
||||
{
|
||||
const QByteArray source =
|
||||
"namespace NS \n"
|
||||
"{\n"
|
||||
" namespace Internal\n"
|
||||
" {\n"
|
||||
" struct S { int member; void fun(); };\n"
|
||||
" }\n"
|
||||
" using Internal::S;\n"
|
||||
"}\n"
|
||||
"using NS::S;\n"
|
||||
"void S::fun()\n"
|
||||
"{\n"
|
||||
" @\n"
|
||||
" // padding so we get the scope right\n"
|
||||
"}\n"
|
||||
;
|
||||
CompletionTestCase test(source, "mem");
|
||||
|
||||
QStringList completions = test.getCompletions();
|
||||
QCOMPARE(completions.size(), 1);
|
||||
QVERIFY(completions.contains(QLatin1String("member")));
|
||||
}
|
||||
|
||||
@@ -1380,6 +1380,9 @@ void CppCompletionAssistProcessor::globalCompletion(CPlusPlus::Scope *currentSco
|
||||
}
|
||||
|
||||
for (; currentBinding; currentBinding = currentBinding->parent()) {
|
||||
foreach (ClassOrNamespace* u, currentBinding->usings())
|
||||
usingBindings.append(u);
|
||||
|
||||
const QList<Symbol *> symbols = currentBinding->symbols();
|
||||
|
||||
if (!symbols.isEmpty()) {
|
||||
|
||||
@@ -179,6 +179,9 @@ private slots:
|
||||
void test_completion_lambdaCalls_4();
|
||||
void test_completion_lambdaCalls_5();
|
||||
|
||||
void test_completion_member_of_class_accessed_by_using_QTCREATORBUG9037_1();
|
||||
void test_completion_member_of_class_accessed_by_using_QTCREATORBUG9037_2();
|
||||
|
||||
void test_completion_local_type_and_member_1();
|
||||
void test_completion_local_type_and_member_2();
|
||||
void test_completion_local_type_and_member_3();
|
||||
|
||||
Reference in New Issue
Block a user