PY-87710 Simplify Black formatter package installation

(cherry picked from commit 43ee408dc90203f15b2c5d4bcef79652f73a1d37)

GitOrigin-RevId: 42922f32cf5485da5a48e1ed2de4d3f986cc711e
This commit is contained in:
Vitaly Legchilkin
2026-02-26 12:30:34 +00:00
committed by intellij-monorepo-bot
parent 51d844aa00
commit e71389d8b8
@@ -145,15 +145,10 @@ class BlackFormatterConfigurable(val project: Project) : BoundConfigurable(PyBun
.applyToComponent { icon = AllIcons.General.Warning }
.component
installButton = button(PyBundle.message("black.install.button.label")) {
runWithModalProgressBlocking(ModalTaskOwner.project(project), PyBundle.message("black.installing.modal.title")) {
if (selectedSdk != null) {
PythonPackageManagerUI.forSdk(project, selectedSdk!!).installPackageBackground(BlackFormatterUtil.PACKAGE_NAME)?.let {
withContext(Dispatchers.EDT) {
isBlackFormatterPackageInstalled = true
enableOnReformatCheckBox.isSelected = true
}
}
}
val sdk = selectedSdk ?: return@button
PythonPackageManagerUI.forSdk(project, sdk).installPackagesWithModalProgressBlocking(BlackFormatterUtil.PACKAGE_NAME)?.let {
isBlackFormatterPackageInstalled = true
enableOnReformatCheckBox.isSelected = true
}
updateUiState()
}.component