void (@NotNull PsiStatement statement, @NotNull List<? super IntentionAction> registrar) { if (!(statement instanceof PsiExpressionStatement)) return; PsiCodeBlock block = ObjectUtils.tryCast(statement.getParent(), PsiCodeBlock.class); if (block == null) return; PsiExpression expression = ((PsiExpressionStatement)statement).getExpression(); if (expression instanceof PsiAssignmentExpression) return; PsiType type = expression.getType(); if (type == null) return; if (!type.equals(PsiTypes.voidType())) { registrar.add(PriorityIntentionActionWrapper.highPriority(QuickFixFactory.getInstance().createIterateFix(expression))); if (PsiTreeUtil.skipWhitespacesAndCommentsForward(statement) == block.getRBrace() && block.getParent() instanceof PsiMethod method) { PsiType returnType = method.getReturnType(); if (returnType != null && isPossibleReturnValue(expression, type, returnType)) { registrar.add(QuickFixFactory.getInstance().createInsertReturnFix(expression)); } } registrar.add(QuickFixFactory.getInstance().createIntroduceVariableAction(expression)); } }