@NotNull
  private static CommonProblemDescriptor createProblemDescriptorFromOfflineDescriptor(@Nullable RefEntity element,
                                                                                      @NotNull OfflineProblemDescriptor offlineDescriptor,
                                                                                      @NotNull QuickFix<?> @NotNull [] fixes,
                                                                                      @NotNull Project project) {
    InspectionManager inspectionManager = InspectionManager.getInstance(project);
    if (element instanceof RefElement refElement) {
      if(refElement.getPsiElement() instanceof PsiFile) {
        PsiElement targetElement = findTargetElementFromOfflineDescriptor((PsiFile)refElement.getPsiElement(), offlineDescriptor, project);
        if(targetElement != null) {
          return inspectionManager.createProblemDescriptor(targetElement, offlineDescriptor.getDescription(), false,
                                                           ProblemHighlightType.GENERIC_ERROR_OR_WARNING, false);
        }
      }
      return new ProblemDescriptorBackedByRefElement(refElement, offlineDescriptor, fixes);
    }
    else if (element instanceof RefModule) {
      return inspectionManager.createProblemDescriptor(offlineDescriptor.getDescription(), ((RefModule)element).getModule(), fixes);
    }
    else {
      return inspectionManager.createProblemDescriptor(offlineDescriptor.getDescription(), 
                                                       ContainerUtil.filter(fixes, f -> !(f instanceof LocalQuickFix)).toArray(QuickFix.EMPTY_ARRAY));
    }
  }
@NotNull
  private static CommonProblemDescriptor createProblemDescriptorFromOfflineDescriptor(@Nullable RefEntity element,
                                                                                      @NotNull OfflineProblemDescriptor offlineDescriptor,
                                                                                      @NotNull QuickFix<?> @NotNull [] fixes,
                                                                                      @NotNull Project project)