default @NotNull ProblemDescriptor getDescriptorForPreview(@NotNull PsiFile target) {
    PsiElement start;
    PsiElement end;
    PsiElement psi;
    try {
      start = PsiTreeUtil.findSameElementInCopy(getStartElement(), target);
      end = PsiTreeUtil.findSameElementInCopy(getEndElement(), target);
      psi = PsiTreeUtil.findSameElementInCopy(getPsiElement(), target);
    }
    catch (ProcessCanceledException e) {
      throw e;
    }
    catch (RuntimeException e) {
      throw new RuntimeException("Failed to obtain element copy for preview; descriptor: " + getDescriptionTemplate(), e);
    }
    ProblemDescriptor pd = this;
    return new ProblemDescriptor() {
      //@formatter:off
      @Override public PsiElement getPsiElement() { return psi;}
      @Override public PsiElement getStartElement() { return start;}
      @Override public PsiElement getEndElement() { return end;}
      @Override public TextRange getTextRangeInElement() { return pd.getTextRangeInElement();}
      @Override public int getLineNumber() { return pd.getLineNumber();}
      @Override public @NotNull ProblemHighlightType getHighlightType() { return pd.getHighlightType();}
      @Override public boolean isAfterEndOfLine() { return pd.isAfterEndOfLine();}
      @Override public void setTextAttributes(TextAttributesKey key) {}
      @Override public @Nullable ProblemGroup getProblemGroup() { return pd.getProblemGroup(); }
      @Override public void setProblemGroup(@Nullable ProblemGroup problemGroup) {}
      @Override public boolean showTooltip() { return pd.showTooltip();}
      @Override public @NotNull String getDescriptionTemplate() { return pd.getDescriptionTemplate();}
      @Override public @NotNull QuickFix @Nullable [] getFixes() { return QuickFix.EMPTY_ARRAY;}
      //@formatter:on
    };
  }
default @NotNull ProblemDescriptor getDescriptorForPreview(@NotNull PsiFile target)