void (@NotNull PsiFile file, @NotNull CharSequence text, int startOffset, int endOffset, @NotNull ProperTextRange priorityRange, @NotNull Collection<? super HighlightInfo> insideResult, @NotNull Collection<? super HighlightInfo> outsideResult) { PsiTodoSearchHelper helper = PsiTodoSearchHelper.getInstance(file.getProject()); if (helper == null || !shouldHighlightTodos(helper, file)) return; TodoItem[] todoItems = helper.findTodoItems(file, startOffset, endOffset); for (TodoItem todoItem : todoItems) { ProgressManager.checkCanceled(); TextRange textRange = todoItem.getTextRange(); List<TextRange> additionalRanges = todoItem.getAdditionalTextRanges(); String description = formatDescription(text, textRange, additionalRanges); String tooltip = XmlStringUtil.escapeString(StringUtil.shortenPathWithEllipsis(description, 1024)).replace("\n", "<br>"); TextAttributes attributes = todoItem.getPattern().getAttributes().getTextAttributes(); addTodoItem(startOffset, endOffset, priorityRange, insideResult, outsideResult, attributes, description, tooltip, textRange); if (!additionalRanges.isEmpty()) { TextAttributes attributesForAdditionalLines = attributes.clone(); attributesForAdditionalLines.setErrorStripeColor(null); for (TextRange range: additionalRanges) { addTodoItem(startOffset, endOffset, priorityRange, insideResult, outsideResult, attributesForAdditionalLines, description, tooltip, range); } } } }