From 12dbfd62da3253f1fcad653e04a729d58f2eaf64 Mon Sep 17 00:00:00 2001 From: Roman Chernyatchik Date: Thu, 10 Oct 2024 16:53:06 +0200 Subject: [PATCH] fix: exception fixed, related to #534 --- .../framework/SmkFrameworkSettingsPanel.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/jetbrains/snakecharm/framework/SmkFrameworkSettingsPanel.java b/src/main/java/com/jetbrains/snakecharm/framework/SmkFrameworkSettingsPanel.java index 5aaef26c..31b60cf8 100644 --- a/src/main/java/com/jetbrains/snakecharm/framework/SmkFrameworkSettingsPanel.java +++ b/src/main/java/com/jetbrains/snakecharm/framework/SmkFrameworkSettingsPanel.java @@ -17,6 +17,7 @@ import com.intellij.ui.ComboboxSpeedSearch; import com.intellij.ui.components.JBLabel; import com.intellij.ui.components.JBTextField; +import com.intellij.util.SlowOperations; import com.intellij.util.messages.MessageBusConnection; import com.intellij.util.ui.UIUtil; import com.intellij.xml.util.XmlStringUtil; @@ -134,16 +135,19 @@ public void jdkNameChanged(@NotNull Sdk jdk, @NotNull String previousName) { refreshSdkList(null); } + @SuppressWarnings("UnstableApiUsage") private void refreshSdkList(Sdk sdkToSelect) { final List sdks = new ArrayList<>(); sdks.add(null); - final List committedSdks = new ArrayList<>(getPythonSdks()); + final ArrayList committedSdks = new ArrayList<>(); + try (var ignored = SlowOperations.knownIssue("https://github.com/JetBrains-Research/snakecharm/issues/534")) { + committedSdks.addAll(getPythonSdks()); + } committedSdks.sort(new PreferredSdkComparator()); sdks.addAll(committedSdks); - //noinspection unchecked - pythonSdkCB.setModel(new CollectionComboBoxModel(sdks, sdkToSelect)); + pythonSdkCB.setModel(new CollectionComboBoxModel<>(sdks, sdkToSelect)); } @NotNull