forked from qt-creator/qt-creator
CppEditor: Make "Complete switch statement" quickfix more visible
Do not require the cursor to be on the "switch" keyword, but allow it to be anywhere within the switch construct. Fixes: QTCREATORBUG-5379 Change-Id: Ic25504237b3ef12958f339d7176dfeeac6bd3466 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -2833,7 +2833,7 @@ void CompleteSwitchCaseStatement::match(const CppQuickFixInterface &interface,
|
||||
AST *ast = path.at(depth);
|
||||
SwitchStatementAST *switchStatement = ast->asSwitchStatement();
|
||||
if (switchStatement) {
|
||||
if (!interface.isCursorOn(switchStatement->switch_token) || !switchStatement->statement)
|
||||
if (!switchStatement->statement)
|
||||
return;
|
||||
CompoundStatementAST *compoundStatement = switchStatement->statement->asCompoundStatement();
|
||||
if (!compoundStatement) // we ignore pathologic case "switch (t) case A: ;"
|
||||
|
||||
Reference in New Issue
Block a user