Do not return todos count for file outside of content roots

This commit is contained in:
Alexander Zolotov
2017-06-14 19:38:56 +03:00
parent d49a74aa1e
commit e62a7b0a91
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2016 JetBrains s.r.o.
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -81,7 +81,7 @@ public class IndexTodoCacheManagerImpl implements TodoCacheManager {
@Override
public int getTodoCount(@NotNull final VirtualFile file, @NotNull final IndexPatternProvider patternProvider) {
if (myProject.isDefault()) {
if (myProject.isDefault() || !ProjectFileIndex.getInstance(myProject).isInContent(file)) {
return 0;
}
if (file instanceof VirtualFileWindow) return -1;
@@ -91,7 +91,7 @@ public class IndexTodoCacheManagerImpl implements TodoCacheManager {
@Override
public int getTodoCount(@NotNull final VirtualFile file, @NotNull final IndexPattern pattern) {
if (myProject.isDefault()) {
if (myProject.isDefault() || !ProjectFileIndex.getInstance(myProject).isInContent(file)) {
return 0;
}
if (file instanceof VirtualFileWindow) return -1;