@Override
  protected @Nullable AnalysisScope getScope(Project project, PsiFile file) {
    Module module = ModuleUtilCore.findModuleForPsiElement(file);
    AnalysisScope analysisScope = new AnalysisScope(file);
    VirtualFile virtualFile = file.getVirtualFile();
    if (file.isPhysical() || virtualFile == null || !virtualFile.isInLocalFileSystem()) {
      analysisScope = new AnalysisScope(project);
    }
    BaseAnalysisActionDialog dlg = new BaseAnalysisActionDialog(
      CodeInsightBundle.message("specify.analysis.scope", InspectionsBundle.message("inspection.action.title")),
      CodeInsightBundle.message("analysis.scope.title", InspectionsBundle.message("inspection.action.noun")), project, BaseAnalysisActionDialog.standardItems(
      project, analysisScope, module, file),
      AnalysisUIOptions.getInstance(project), true);
    if (!dlg.showAndGet()) {
      return null;
    }
    return dlg.getScope(analysisScope);
  }
@Override
  protected @Nullable AnalysisScope getScope(Project project, PsiFile file)