@Override
  public ProblemDescriptor @Nullable [] checkFile(@NotNull PsiFile file, @NotNull InspectionManager manager, boolean isOnTheFly) {
    final List<TextRange> ranges = getTodoRanges(file);
    if (ranges.isEmpty()) {
      return null;
    }

    final List<ProblemDescriptor> result = new SmartList<>();
    int lastEndOffset = -1;
    for (TextRange todoRange : ranges) {
      final int todoStart = todoRange.getStartOffset();
      final int todoEnd = todoRange.getEndOffset();
      if (todoStart < lastEndOffset) continue;
      PsiElement element = file.findElementAt(todoStart);
      while (element != null && element.getTextRange().getEndOffset() < todoEnd) element = element.getParent();
      if (element != null) {
        final int elementStart = element.getTextRange().getStartOffset();
        final TextRange range = new TextRange(todoStart - elementStart, todoEnd - elementStart);
        final String message = onlyWarnOnEmpty
                               ? LangBundle.message("todo.comment.without.details.problem.descriptor")
                               : LangBundle.message("todo.comment.problem.descriptor");
        result.add(manager.createProblemDescriptor(element, range, message, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, isOnTheFly));
        lastEndOffset = todoEnd;
      }
    }
    return result.toArray(ProblemDescriptor.EMPTY_ARRAY);
  }
@Override
  public ProblemDescriptor @Nullable [] checkFile(@NotNull PsiFile file, @NotNull InspectionManager manager, boolean isOnTheFly)