use of com.intellij.psi.search.IndexPatternOccurrence in project intellij-community by JetBrains.
the class PsiTodoSearchHelperImpl method processTodoOccurences.
@NotNull
private static TodoItem[] processTodoOccurences(int startOffset, int endOffset, Collection<IndexPatternOccurrence> occurrences) {
List<TodoItem> items = new ArrayList<>(occurrences.size());
TextRange textRange = new TextRange(startOffset, endOffset);
final TodoItemsCreator todoItemsCreator = new TodoItemsCreator();
for (IndexPatternOccurrence occurrence : occurrences) {
TextRange occurrenceRange = occurrence.getTextRange();
if (textRange.contains(occurrenceRange)) {
items.add(todoItemsCreator.createTodo(occurrence));
}
}
return items.toArray(new TodoItem[items.size()]);
}
Aggregations