@Override
  public @NotNull IntentionPreviewInfo generatePreview(@NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file) {
    PsiElement element = PsiTreeUtil.findSameElementInCopy(getStartElement(), file);
    PsiElement parent = element.getParent();
    if (parent instanceof PsiClassOwner classOwner && classOwner.getClasses().length == 1 && classOwner.getClasses()[0] == element) {
      var doc = file.getViewProvider().getDocument();
      doc.deleteString(0, doc.getTextLength());
    }
    else {
      element.delete();
    }
    return IntentionPreviewInfo.DIFF;
  }
@Override
  public @NotNull IntentionPreviewInfo generatePreview(@NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file)