Commit 09559064 authored by Alexander Lobas's avatar Alexander Lobas
Browse files

IDEA-205534 Typing lags in plugins search UI

parent 282fcb92
Showing with 21 additions and 1 deletion
+21 -1
......@@ -136,6 +136,7 @@ public class PluginManagerConfigurableNew
private Map<String, List<IdeaPluginDescriptor>> myCustomRepositoriesMap;
private final Object myRepositoriesLock = new Object();
private List<String> myAllTagSorted;
private Map<String, List<IdeaPluginDescriptor>> mySuggestCache;
private boolean myIgnoreFocusFromBackButton;
......@@ -1033,7 +1034,7 @@ public class PluginManagerConfigurableNew
return;
}
List<IdeaPluginDescriptor> result = loadSuggestPlugins(query);
List<IdeaPluginDescriptor> result = getSuggestPlugins(query);
if (result.isEmpty()) {
hidePopup();
return;
......@@ -1087,6 +1088,23 @@ public class PluginManagerConfigurableNew
myPopup.createAndShow(callback, renderer, async);
}
@NotNull
private List<IdeaPluginDescriptor> getSuggestPlugins(@NotNull String query) {
if (mySuggestCache == null) {
mySuggestCache = new HashMap<>();
}
List<IdeaPluginDescriptor> result = mySuggestCache.get(query);
if (result == null) {
result = loadSuggestPlugins(query);
if (!query.isEmpty() && !result.isEmpty()) {
mySuggestCache.put(query, result);
}
}
return result;
}
@NotNull
private List<IdeaPluginDescriptor> loadSuggestPlugins(@NotNull String query) {
Set<IdeaPluginDescriptor> result = new LinkedHashSet<>();
......@@ -1314,6 +1332,8 @@ public class PluginManagerConfigurableNew
myCustomRepositoriesMap = null;
}
mySuggestCache = null;
myPluginUpdatesService.recalculateUpdates();
if (myTrendingPanel == null && myUpdatesPanel == null) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment