private static @Nullable PsiFile getPsiFile(@NotNull ProblemDescriptor descriptor) {
    PsiElement startElement = descriptor.getStartElement();
    if (startElement != null) {
      return startElement.getContainingFile();
    }
    PsiElement endElement = descriptor.getEndElement();
    if (endElement != null) {
      return endElement.getContainingFile();
    }
    return null;
  }
private static @Nullable PsiFile getPsiFile(@NotNull ProblemDescriptor descriptor)