DependencyScope (@NotNull Module module, @Nullable PsiElement location) { if (location != null) { final VirtualFile vFile = location.getContainingFile().getVirtualFile(); if (vFile != null && ModuleRootManager.getInstance(module).getFileIndex().isInTestSourceContent(vFile)) { return DependencyScope.TEST; } } return DependencyScope.COMPILE; }