@Override
  public @NotNull IntentionPreviewInfo generatePreview(@NotNull Project project, @NotNull ProblemDescriptor previewDescriptor) {
    PsiElement element = getElementToRefactor(previewDescriptor.getPsiElement());
    if (element instanceof PsiNamedElement namedElement) {
      if (m_targetName == null) {
        String what = UsageViewUtil.getType(element) + " '" + namedElement.getName() + "'";
        String message = RefactoringBundle.message("rename.0.and.its.usages.preview.text", what);
        return new IntentionPreviewInfo.Html(HtmlChunk.text(message));
      }
      namedElement.setName(m_targetName);
      return IntentionPreviewInfo.DIFF;
    }
    return IntentionPreviewInfo.EMPTY;
  }
@Override
  public @NotNull IntentionPreviewInfo generatePreview(@NotNull Project project, @NotNull ProblemDescriptor previewDescriptor)