IDEA-53989: Editor allows production code in module A to reference test code in modul...
authorDmitry Avdeev <Dmitry.Avdeev@jetbrains.com>
Mon, 19 Apr 2010 06:54:32 +0000 (10:54 +0400)
committerDmitry Avdeev <Dmitry.Avdeev@jetbrains.com>
Mon, 19 Apr 2010 06:54:32 +0000 (10:54 +0400)
platform/lang-impl/src/com/intellij/openapi/module/impl/scopes/ModuleWithDependenciesScope.java

index f7b2a7c26b3c764bae2a80ad54bc347b8034793c..d1e06aaceb53a1b64fd1dfaf086e6a69f91fd215 100644 (file)
@@ -92,7 +92,9 @@ public class ModuleWithDependenciesScope extends GlobalSearchScope {
 
     if (myModules != null) {
       final Module module = myProjectFileIndex.getModuleForFile(file);
-      if (module != null) return myModules.contains(module) && myFileIndex.getOrderEntryForFile(file) != null;
+      if (module != null) return myModules.contains(module) &&
+                                 myFileIndex.getOrderEntryForFile(file) != null &&
+                                 (myIncludeTests || !myProjectFileIndex.isInTestSourceContent(file));
     }
 
     final List<OrderEntry> entries = myFileIndex.getOrderEntriesForFile(file);