List<NamedScope> (@NotNull Project project) { Set<NamedScope> allScopes = new LinkedHashSet<>(); for (CustomScopesProvider scopesProvider : CustomScopesProvider.CUSTOM_SCOPES_PROVIDER.getExtensions(project)) { List<NamedScope> customScopes = scopesProvider.getFilteredScopes(); if (customScopes.contains(null)) { throw PluginException.createByClass("CustomScopesProvider::getFilteredScopes() must not return null scopes, got: " + customScopes + "; provider: " + scopesProvider + " (" + scopesProvider.getClass() + ")", null, scopesProvider.getClass()); } allScopes.addAll(customScopes); } return new ArrayList<>(allScopes); }