@Override
  public @Nullable Presentation getPresentation(@NotNull ActionContext context) {
    if (!BaseIntentionAction.canModify(context.file())) return null;
    List<PsiStatement> statements = extractStatements(context);
    if (statements.isEmpty()) return null;
    PsiElement prev = PsiTreeUtil.skipWhitespacesAndCommentsBackward(statements.get(0));
    if (!(prev instanceof PsiIfStatement ifStatement) || hasConflictingDeclarations(ifStatement, statements)) return null;
    return Presentation.of(getFamilyName());
  }
@Override
  public @Nullable Presentation getPresentation(@NotNull ActionContext context)