public static @NotNull Map<TodoIndexEntry, Integer> calcTodoEntries(@NotNull FileContent content,
                                                                      @NotNull IdAndToDoScannerBasedOnFilterLexer indexer) {
    boolean needTodo = TodoIndexers.needsTodoIndex(content) || content.getFile() instanceof LightVirtualFile;
    IndexPattern[] todoPatterns = needTodo ? IndexPatternUtil.getIndexPatterns() : IndexPattern.EMPTY_ARRAY;
    if (todoPatterns.length == 0) return Collections.emptyMap();

    OccurrenceConsumer occurrenceConsumer = new OccurrenceConsumer(null, true);
    scanContentWithCheckCanceled(content, indexer.createLexer(occurrenceConsumer));

    Map<TodoIndexEntry, Integer> todoMap = null;
    for (IndexPattern indexPattern : todoPatterns) {
      int count = occurrenceConsumer.getOccurrenceCount(indexPattern);
      if (count <= 0) continue;
      if (todoMap == null) todoMap = new HashMap<>();
      todoMap.put(new TodoIndexEntry(indexPattern.getPatternString(), indexPattern.isCaseSensitive()), count);
    }
    return todoMap != null ? todoMap : Collections.emptyMap();
  }
public static @NotNull Map<TodoIndexEntry, Integer> calcTodoEntries(@NotNull FileContent content,
                                                                      @NotNull IdAndToDoScannerBasedOnFilterLexer indexer)