IDEADEV-42191: The file may belong to a library AND the source root of the module at the same time.

This commit is contained in:
Maxim Shafirov
2010-01-12 17:57:00 +03:00
parent c39abcfb73
commit 0ce2ecd8e5
2 changed files with 6 additions and 4 deletions
@@ -63,9 +63,11 @@ public class ProjectScope {
private final ProjectFileIndex myFileIndex = projectRootManager.getFileIndex();
public boolean contains(VirtualFile file) {
if (myFileIndex.isInLibraryClasses(file)) return false;
if (file instanceof VirtualFileWindow) return true;
return file instanceof VirtualFileWindow || myFileIndex.isInContent(file);
if (myFileIndex.isInLibraryClasses(file) && !myFileIndex.isInSourceContent(file)) return false;
return myFileIndex.isInContent(file);
}
public int compare(VirtualFile file1, VirtualFile file2) {
@@ -107,4 +109,4 @@ public class ProjectScope {
}
return projectScope;
}
}
}
@@ -80,7 +80,7 @@ public class ModuleWithDependentsScope extends GlobalSearchScope {
if (moduleOfFile == null) return false;
if (!myModules.contains(moduleOfFile)) return false;
if (myOnlyTests && !myProjectFileIndex.isInTestSourceContent(file)) return false;
if (myProjectFileIndex.isInLibraryClasses(file)) return false;
if (myProjectFileIndex.isInLibraryClasses(file) && !myProjectFileIndex.isInSourceContent(file)) return false;
return true;
}