void (@NotNull String query, @NotNull PluginsGroup result) { try { SearchQueryParser.Marketplace parser = new SearchQueryParser.Marketplace(query); if (parser.internal) { PluginsViewCustomizer.PluginsGroupDescriptor groupDescriptor = getPluginsViewCustomizer().getInternalPluginsGroupDescriptor(); if (groupDescriptor != null) { if (parser.searchQuery == null) { result.descriptors.addAll(groupDescriptor.getPlugins()); } else { for (IdeaPluginDescriptor pluginDescriptor : groupDescriptor.getPlugins()) { if (StringUtil.containsIgnoreCase(pluginDescriptor.getName(), parser.searchQuery)) { result.descriptors.add(pluginDescriptor); } } } ContainerUtil.removeDuplicates(result.descriptors); result.sortByName(); return; } } Map<String, List<PluginNode>> customRepositoriesMap = CustomPluginRepositoryService.getInstance().getCustomRepositoryPluginMap(); if (parser.suggested && project != null) { result.descriptors.addAll(PluginsAdvertiserStartupActivityKt.findSuggestedPlugins(project, customRepositoriesMap)); } else if (!parser.repositories.isEmpty()) { for (String repository : parser.repositories) { List<PluginNode> descriptors = customRepositoriesMap.get(repository); if (descriptors == null) { continue; } if (parser.searchQuery == null) { result.descriptors.addAll(descriptors); } else { for (PluginNode descriptor : descriptors) { if (StringUtil.containsIgnoreCase(descriptor.getName(), parser.searchQuery)) { result.descriptors.add(descriptor); } } } } ContainerUtil.removeDuplicates(result.descriptors); result.sortByName(); } else { List<PluginNode> pluginsFromMarketplace = myMarketplaceRequests.searchPlugins(parser.getUrlQuery(), 10000, true); // compare plugin versions between marketplace & custom repositories List<PluginNode> customPlugins = ContainerUtil.flatten(customRepositoriesMap.values()); Collection<PluginNode> plugins = RepositoryHelper.mergePluginsFromRepositories(pluginsFromMarketplace, customPlugins, false); result.descriptors.addAll(0, plugins); if (parser.searchQuery != null) { List<PluginNode> descriptors = ContainerUtil.filter(customPlugins, descriptor -> StringUtil.containsIgnoreCase(descriptor.getName(), parser.searchQuery)); result.descriptors.addAll(0, descriptors); } ContainerUtil.removeDuplicates(result.descriptors); if (!result.descriptors.isEmpty()) { String title = IdeBundle.message("plugin.manager.action.label.sort.by.1"); for (AnAction action : myMarketplaceSortByGroup.getChildren(null)) { MarketplaceSortByAction sortByAction = (MarketplaceSortByAction)action; sortByAction.setState(parser); if (sortByAction.myState) { title = IdeBundle.message("plugin.manager.action.label.sort.by", sortByAction.myOption.getPresentableNameSupplier().get()); } } myMarketplaceSortByAction.setText(title); result.addRightAction(myMarketplaceSortByAction); Collection<IdeaPluginDescriptor> updates = PluginUpdatesService.getUpdates(); if (!ContainerUtil.isEmpty(updates)) { myPostFillGroupCallback = () -> { applyUpdates(myPanel, updates); selectionListener.accept(myMarketplacePanel); }; } } } PluginManagerUsageCollector.performMarketplaceSearch(ProjectUtil.getActiveProject(), parser, result.descriptors); } catch (IOException e) { LOG.info(e); ApplicationManager.getApplication().invokeLater( () -> myPanel.getEmptyText() .setText(IdeBundle.message("plugins.configurable.search.result.not.loaded")) .appendSecondaryText( IdeBundle.message("plugins.configurable.check.internet"), StatusText.DEFAULT_ATTRIBUTES, null), ModalityState.any() ); } }