List<IdeaPluginDescriptorImpl> (@NotNull Collection<IdeaPluginDescriptorImpl> descriptors, @NotNull Map<PluginId, PluginEnabledState> enabledMap, @NotNull Map<PluginId, IdeaPluginDescriptorImpl> pluginIdMap) { ArrayList<IdeaPluginDescriptorImpl> result = new ArrayList<>(); Set<PluginId> pluginIds = descriptors.stream() .map(IdeaPluginDescriptorImpl::getPluginId) .collect(Collectors.toUnmodifiableSet()); for (IdeaPluginDescriptorImpl descriptor : PluginManagerCore.INSTANCE.getPluginSet().allPlugins) { PluginId pluginId = descriptor.getPluginId(); if (pluginIds.contains(pluginId) || isDisabled(pluginId, enabledMap)) { continue; } PluginManagerCore.INSTANCE.processAllNonOptionalDependencies(descriptor, pluginIdMap, dependency -> { PluginId dependencyId = dependency.getPluginId(); if (!isLoaded(dependencyId, enabledMap)) { return FileVisitResult.TERMINATE; } if (!dependencyId.equals(pluginId) && pluginIds.contains(dependencyId)) { result.add(descriptor); } return FileVisitResult.CONTINUE; }); } return Collections.unmodifiableList(result); }