mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user