forked from qt-creator/qt-creator
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:
committed by
Nikolai Kosjar
parent
e1db88e113
commit
20a23ec72b
@@ -2609,6 +2609,8 @@ void InsertDefFromDecl::match(const CppQuickFixInterface &interface, QuickFixOpe
|
||||
for (; idx >= 0; --idx) {
|
||||
AST *node = path.at(idx);
|
||||
if (SimpleDeclarationAST *simpleDecl = node->asSimpleDeclaration()) {
|
||||
if (idx > 0 && path.at(idx - 1)->asStatement())
|
||||
return;
|
||||
if (simpleDecl->symbols && ! simpleDecl->symbols->next) {
|
||||
if (Symbol *symbol = simpleDecl->symbols->value) {
|
||||
if (Declaration *decl = symbol->asDeclaration()) {
|
||||
|
||||
Reference in New Issue
Block a user