Search in sources :

Example 1 with TodoCheckinHandlerWorker

use of com.intellij.openapi.vcs.checkin.TodoCheckinHandlerWorker in project intellij-community by JetBrains.

the class CustomChangelistTodosTreeBuilder method findPatternedTodoItems.

private TodoItem[] findPatternedTodoItems(PsiFile file, final TodoFilter todoFilter) {
    if (!myIncludedFiles.contains(file))
        return EMPTY_ITEMS;
    if (myDirtyFileSet.contains(file.getVirtualFile())) {
        myMap.remove(file);
        final Change change = myChangeListManager.getChange(file.getVirtualFile());
        if (change != null) {
            final TodoCheckinHandlerWorker worker = new TodoCheckinHandlerWorker(myProject, Collections.singletonList(change), todoFilter, true);
            worker.execute();
            final List<TodoItem> todoItems = worker.inOneList();
            if (todoItems != null && !todoItems.isEmpty()) {
                for (TodoItem todoItem : todoItems) {
                    myMap.putValue(file, todoItem);
                }
            }
        }
    }
    final Collection<TodoItem> todoItems = myMap.get(file);
    return todoItems == null || todoItems.isEmpty() ? EMPTY_ITEMS : todoItems.toArray(new TodoItem[todoItems.size()]);
}
Also used : TodoItem(com.intellij.psi.search.TodoItem) Change(com.intellij.openapi.vcs.changes.Change) TodoCheckinHandlerWorker(com.intellij.openapi.vcs.checkin.TodoCheckinHandlerWorker)

Aggregations

Change (com.intellij.openapi.vcs.changes.Change)1 TodoCheckinHandlerWorker (com.intellij.openapi.vcs.checkin.TodoCheckinHandlerWorker)1 TodoItem (com.intellij.psi.search.TodoItem)1