@NotNull
  private static GlobalSearchScope calcScope(@NotNull PsiFile file, @Nullable Module module) {
    if (module == null) {
      return file.getResolveScope();
    }

    file = file.getOriginalFile();
    VirtualFile virtualFile = file.getVirtualFile();
    if (virtualFile == null) {
      return GlobalSearchScope.moduleRuntimeScope(module, true);
    }

    return module.getModuleRuntimeScope(TestSourcesFilter.isTestSources(virtualFile, file.getProject()));
  }
@NotNull
  private static GlobalSearchScope calcScope(@NotNull PsiFile file, @Nullable Module module)