@Override
  public @Nullable Presentation getPresentation(@NotNull ActionContext context) {
    if (!(context.file() instanceof PsiJavaFile)) return null;
    if (!BaseIntentionAction.canModify(context.file())) return null;
    PsiClassType exception = getRuntimeExceptionAtCaret(context);
    if (exception == null) return null;

    PsiMethod method = PsiTreeUtil.getParentOfType(context.findLeaf(), PsiMethod.class, true, PsiLambdaExpression.class);
    if (method == null || !method.getThrowsList().isPhysical() || isMethodThrows(method, exception)) return null;

    return switch (myProcessHierarchy) {
      case YES -> Presentation.of(QuickFixBundle.message("add.exception.to.throws.hierarchy"));
      case NO -> Presentation.of(QuickFixBundle.message("add.exception.to.throws.only.this"));
      case UNSURE ->
        Presentation.of(QuickFixBundle.message("add.runtime.exception.to.throws.text", "throws " + exception.getPresentableText()));
    };
  }
@Override
  public @Nullable Presentation getPresentation(@NotNull ActionContext context)