int (@NotNull PsiFile file) { VirtualFile virtualFile = file.getVirtualFile(); if (virtualFile != null) { int count = TodoCacheManager.getInstance(myProject).getTodoCount(virtualFile, TodoIndexPatternProvider.getInstance()); if (count != -1) return count; } return findTodoItems(file).length; }