boolean (String pattern, Predicate<? super MatchedValue> consumer) { Project project = myModel.getProject(); CollectConsumer<Object> collector = new CollectConsumer<>(); String commandAccelerator = SearchTopHitProvider.getTopHitAccelerator(); for (SearchTopHitProvider provider : SearchTopHitProvider.EP_NAME.getExtensionList()) { //noinspection deprecation if (provider instanceof OptionsTopHitProvider.CoveredByToggleActions) { continue; } if (provider instanceof OptionsSearchTopHitProvider && !pattern.startsWith(commandAccelerator)) { String prefix = commandAccelerator + ((OptionsSearchTopHitProvider)provider).getId() + " "; provider.consumeTopHits(prefix + pattern, collector, project); } else if (project != null && provider instanceof OptionsTopHitProvider.ProjectLevelProvidersAdapter) { ((OptionsTopHitProvider.ProjectLevelProvidersAdapter)provider).consumeAllTopHits(pattern, collector, project); } provider.consumeTopHits(pattern, collector, project); } Collection<Object> result = collector.getResult(); Stream<?> wrappers = result.stream() .map(object -> object instanceof AnAction ? wrapAnAction((AnAction)object) : object); return processItems(pattern, MatchedValueType.TOP_HIT, wrappers, consumer); }