private static @NotNull SearchScope restrictScope(@NotNull SearchScope baseScope,
                                                    @NotNull List<ScopeOptimizer> optimizers,
                                                    @NotNull PsiElement element) {
    SearchScope scopeToRestrict = ScopeOptimizer.calculateOverallRestrictedUseScope(optimizers, element);
    if (scopeToRestrict != null) {
      return baseScope.intersectWith(scopeToRestrict);
    }

    return baseScope;
  }
private static @NotNull SearchScope restrictScope(@NotNull SearchScope baseScope,
                                                    @NotNull List<ScopeOptimizer> optimizers,
                                                    @NotNull PsiElement element)