boolean (final Project project, final VirtualFile virtualFile, final VirtualFile targetVirtualFile) { final boolean inTestSourceContent = ProjectRootManager.getInstance(project).getFileIndex().isInTestSourceContent(virtualFile); final Module module = ModuleUtilCore.findModuleForFile(virtualFile, project); if (targetVirtualFile != null && module != null && !GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(module, inTestSourceContent).contains(targetVirtualFile)) { return false; } return true; }