Search in sources :

Example 11 with TodoItem

use of com.intellij.psi.search.TodoItem in project intellij-community by JetBrains.

the class PsiTodoSearchHelperImpl method getTodoItemsCount.

@Override
public int getTodoItemsCount(@NotNull PsiFile file, @NotNull TodoPattern pattern) {
    int count = TodoCacheManager.SERVICE.getInstance(myManager.getProject()).getTodoCount(file.getVirtualFile(), pattern.getIndexPattern());
    if (count != -1)
        return count;
    TodoItem[] items = findTodoItems(file);
    count = 0;
    for (TodoItem item : items) {
        if (item.getPattern().equals(pattern))
            count++;
    }
    return count;
}
Also used : TodoItem(com.intellij.psi.search.TodoItem)

Aggregations

TodoItem (com.intellij.psi.search.TodoItem)11 Document (com.intellij.openapi.editor.Document)4 TextRange (com.intellij.openapi.util.TextRange)3 ArrayList (java.util.ArrayList)3 AbstractTreeNode (com.intellij.ide.util.treeView.AbstractTreeNode)2 TextAttributes (com.intellij.openapi.editor.markup.TextAttributes)2 Change (com.intellij.openapi.vcs.changes.Change)2 NotNull (org.jetbrains.annotations.NotNull)2 DocumentWindow (com.intellij.injected.editor.DocumentWindow)1 RangeMarker (com.intellij.openapi.editor.RangeMarker)1 EditorHighlighter (com.intellij.openapi.editor.highlighter.EditorHighlighter)1 HighlighterIterator (com.intellij.openapi.editor.highlighter.HighlighterIterator)1 Computable (com.intellij.openapi.util.Computable)1 TodoCheckinHandlerWorker (com.intellij.openapi.vcs.checkin.TodoCheckinHandlerWorker)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 PsiComment (com.intellij.psi.PsiComment)1 TodoItemImpl (com.intellij.psi.impl.search.TodoItemImpl)1 IndexPatternOccurrence (com.intellij.psi.search.IndexPatternOccurrence)1 PsiTodoSearchHelper (com.intellij.psi.search.PsiTodoSearchHelper)1 HighlightedRegion (com.intellij.ui.HighlightedRegion)1