CppEditor: Do not show InsertDefFromDecl if triggered on a statement

Change-Id: Ib0b110ac80d9519461a6ba6cf5b7c77925ed2ea5
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
Lorenz Haas
2013-05-24 10:32:50 +02:00
committed by Nikolai Kosjar
parent e1db88e113
commit 20a23ec72b
3 changed files with 21 additions and 0 deletions

View File

@@ -908,6 +908,24 @@ void CppEditorPlugin::test_quickfix_InsertDefFromDecl_notTriggeringWhenDefinitio
data.run(&factory, 1);
}
/// Check not triggering when it is a statement
void CppEditorPlugin::test_quickfix_InsertDefFromDecl_notTriggeringStatement()
{
const QByteArray original =
"class Foo {\n"
"public:\n"
" Foo() {}\n"
"};\n"
"void freeFunc() {\n"
" Foo @f();"
"}\n";
const QByteArray expected = original + "\n";
InsertDefFromDecl factory;
TestCase data(original, expected);
data.run(&factory);
}
// Function for one of InsertDeclDef section cases
void insertToSectionDeclFromDef(const QByteArray &section, int sectionIndex)
{