@Override
  public int getTodoItemsCount(@NotNull PsiFile file, @NotNull TodoPattern pattern) {
    VirtualFile virtualFile = file.getVirtualFile();
    int count = 0;
    if (virtualFile != null) {
      count = TodoCacheManager.getInstance(myProject).getTodoCount(virtualFile, pattern.getIndexPattern());
      if (count != -1) return count;
    }
    TodoItem[] items = findTodoItems(file);
    for (TodoItem item : items) {
      if (Objects.equals(item.getPattern(), pattern)) count++;
    }
    return count;
  }
@Override
  public int getTodoItemsCount(@NotNull PsiFile file, @NotNull TodoPattern pattern)