From 0955865e8f605c871afb5d58b29006f51e07e5da Mon Sep 17 00:00:00 2001 From: Vitaly Legchilkin Date: Wed, 22 Oct 2025 14:16:45 +0200 Subject: [PATCH] [python] (PY-84985) fix typo and simplify expression (cherry picked from commit afffca848993dee842d4f0a50e290d99f9de079d) IJ-MR-179540 GitOrigin-RevId: 6d1fc8c32c5bc1fcded273cc8dc548b39b422416 --- .../python/sdk/add/v2/hatch/HatchUIComponents.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/python/src/com/jetbrains/python/sdk/add/v2/hatch/HatchUIComponents.kt b/python/src/com/jetbrains/python/sdk/add/v2/hatch/HatchUIComponents.kt index a07cc7183da9..61c1da08fcb8 100644 --- a/python/src/com/jetbrains/python/sdk/add/v2/hatch/HatchUIComponents.kt +++ b/python/src/com/jetbrains/python/sdk/add/v2/hatch/HatchUIComponents.kt @@ -101,16 +101,16 @@ private class HatchEnvComboBoxListCellRenderer(val contentFlow: StateFlow Panel.addEnvironmentComboBox( model: PythonAddInterpreterModel

, validationRequestor: DialogValidationRequestor, - isValidateOnlyNotExisting: Boolean, + isGenerateNewMode: Boolean, ): ComboBox { val environmentAlreadyExists = AtomicBooleanProperty(false) lateinit var environmentComboBox: ComboBox - val hatchEnvironmentProperty = if (isValidateOnlyNotExisting) - model.hatchViewModel.selectedEnvFromExisting - else + val hatchEnvironmentProperty = if (isGenerateNewMode) model.hatchViewModel.selectedEnvFromAvailable + else + model.hatchViewModel.selectedEnvFromExisting row(message("sdk.create.custom.hatch.environment")) { environmentComboBox = comboBox(emptyList(), HatchEnvComboBoxListCellRenderer(model.hatchViewModel.availableEnvironments)) @@ -123,7 +123,7 @@ private fun

Panel.addEnvironmentComboBox( component.item == null -> { ValidationInfo(message("sdk.create.custom.hatch.error.no.environments.to.select")) } - isValidateOnlyNotExisting && component.item?.pythonVirtualEnvironment is PythonVirtualEnvironment.Existing -> { + isGenerateNewMode && component.item?.pythonVirtualEnvironment is PythonVirtualEnvironment.Existing -> { environmentAlreadyExists.set(true) ValidationInfo(message("sdk.create.custom.hatch.environment.exists")) } @@ -220,7 +220,7 @@ internal fun

Panel.buildHatchFormFields( environmentComboBox = addEnvironmentComboBox( model = model, validationRequestor = validationRequestor, - isValidateOnlyNotExisting = isGenerateNewMode + isGenerateNewMode = isGenerateNewMode ) if (isGenerateNewMode) {