@Override
  public void reportProblems(@NotNull VirtualFile file, @NotNull Collection<? extends Problem> problems) {
    ApplicationManager.getApplication().assertIsNonDispatchThread();

    if (problems.isEmpty()) {
      clearProblems(file);
      return;
    }
    if (!isToBeHighlighted(file)) return;
    boolean hasProblemsBefore;
    boolean fireChanged;
    ProblemFileInfo newInfo = new ProblemFileInfo();
    for (Problem problem : problems) {
      newInfo.problems.add(problem);
      newInfo.hasSyntaxErrors |= ((ProblemImpl)problem).isSyntaxOnly();
    }
    ProblemFileInfo oldInfo = myProblems.put(file, newInfo);
    hasProblemsBefore = oldInfo != null;
    fireChanged = hasProblemsBefore && !oldInfo.equals(newInfo);

    doQueue(file);
    boolean hasExternal = hasProblemsFromExternalSources(file);
    if (!hasProblemsBefore && !hasExternal) {
      fireProblemsAppeared(file);
    }
    else if (fireChanged || hasExternal) {
      fireProblemsChanged(file);
    }
  }
@Override
  public void reportProblems(@NotNull VirtualFile file, @NotNull Collection<? extends Problem> problems)