@Nullable
  public static <T extends PsiElement> T findSameElementForPreview(@Nullable SmartPsiElementPointer<T> pointer,
                                                                   @NotNull PsiFile previewFile) {
    if (pointer == null) return null;
    T element = pointer.getElement();
    if (element == null) return null;
    return PsiTreeUtil.findSameElementInCopy(element, previewFile);
  }
@Nullable
  public static <T extends PsiElement> T findSameElementForPreview(@Nullable SmartPsiElementPointer<T> pointer,
                                                                   @NotNull PsiFile previewFile)