PY-39011 Fix loss of Path Mappings field in Project Interpreter settings

The logic of `PyActiveSdkConfigurable` had been slightly changed previously. This resulted in the loss of the event of setting initial SDK in "Project Interpreter" combo box.

GitOrigin-RevId: 4a435344f36f8f8a8a85bccd582746175a272656
This commit is contained in:
Alexander Koshevoy
2019-11-25 12:52:54 +03:00
committed by intellij-monorepo-bot
parent 77498180ca
commit 3e81c18ec6

View File

@@ -332,6 +332,9 @@ public class PyActiveSdkConfigurable implements UnnamedConfigurable {
mySdkCombo.setRenderer(new PySdkListCellRenderer(null));
final Sdk selection = selectedSdk == null ? null : myProjectSdksModel.findSdk(selectedSdk.getName());
mySdkCombo.setModel(new CollectionComboBoxModel<>(items, selection));
// The call of `setSelectedItem` is required to notify `PyPathMappingsUiProvider` about initial setting of `Sdk` via `setModel` above
// Fragile as it is vulnerable to changes of `setSelectedItem` method in respect to processing `ActionEvent`
mySdkCombo.setSelectedItem(selection);
onSdkSelected();
}