mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-186805 Rework plugin page: add custom repositories to search sources
This commit is contained in:
+31
-3
@@ -677,13 +677,41 @@ public class PluginManagerConfigurableNew
|
||||
}
|
||||
}
|
||||
|
||||
List<IdeaPluginDescriptor> list = RepositoryHelper.loadPlugins(null);
|
||||
List<IdeaPluginDescriptor> list = new ArrayList<>();
|
||||
Map<String, IdeaPluginDescriptor> map = new HashMap<>();
|
||||
IOException exception = null;
|
||||
|
||||
for (IdeaPluginDescriptor plugin : list) {
|
||||
map.put(plugin.getPluginId().getIdString(), plugin);
|
||||
for (String host : RepositoryHelper.getPluginHosts()) {
|
||||
try {
|
||||
for (IdeaPluginDescriptor plugin : RepositoryHelper.loadPlugins(host, null)) {
|
||||
String id = plugin.getPluginId().getIdString();
|
||||
if (!map.containsKey(id)) {
|
||||
list.add(plugin);
|
||||
map.put(id, plugin);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (IOException e) {
|
||||
if (host == null) {
|
||||
exception = e;
|
||||
}
|
||||
else {
|
||||
PluginManagerMain.LOG.info(host, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (exception != null) {
|
||||
throw exception;
|
||||
}
|
||||
|
||||
ApplicationManager.getApplication().invokeLater(() -> {
|
||||
InstalledPluginsState state = InstalledPluginsState.getInstance();
|
||||
for (IdeaPluginDescriptor descriptor : list) {
|
||||
state.onDescriptorDownload(descriptor);
|
||||
}
|
||||
});
|
||||
|
||||
synchronized (myJBRepositoryLock) {
|
||||
if (myJBRepositoryList == null) {
|
||||
myJBRepositoryList = list;
|
||||
|
||||
Reference in New Issue
Block a user