public static GlobalSearchScope getScope(Project project, @Nullable Module module, @Nullable PsiFile psiFile) {
    if (module == null || psiFile == null) {
      return ProjectScope.getAllScope(project);
    }

    VirtualFile file = psiFile.getOriginalFile().getVirtualFile();
    if (file == null) {
      return ProjectScope.getAllScope(project);
    }
    final boolean inTests = TestSourcesFilter.isTestSources(file, project);

    return module.getModuleRuntimeScope(inTests);
  }
public static GlobalSearchScope getScope(Project project, @Nullable Module module, @Nullable PsiFile psiFile)