Python: Close classes that aren't part of the public API.

`PySdkToInstall` breaks LSP and will be deleted soon. Do not use it

GitOrigin-RevId: 1dd7ede18ac1f92aafffd03d7b50fcd922c4b226
This commit is contained in:
Ilya.Kazakevich
2024-10-03 15:41:11 +02:00
committed by intellij-monorepo-bot
parent e82a1d364e
commit ff33887a25

View File

@@ -25,6 +25,7 @@ import org.jetbrains.annotations.CalledInAny
val LOGGER = Logger.getInstance(PySdkToInstall::class.java)
@CalledInAny
@Internal
fun getSdksToInstall(): List<PySdkToInstall> {
return PySdkToInstallManager.getAvailableVersionsToInstall().map {
PySdkToInstall(it.value)
@@ -32,6 +33,7 @@ fun getSdksToInstall(): List<PySdkToInstall> {
}
@RequiresEdt
@Internal
fun installSdkIfNeeded(sdk: Sdk, module: Module?, existingSdks: List<Sdk>, context: UserDataHolder? = null): Result<Sdk> =
if (sdk is PySdkToInstall) sdk.install(module) {
context?.let { detectSystemWideSdks(module, existingSdks, context) } ?: detectSystemWideSdks(module, existingSdks)
@@ -42,6 +44,7 @@ fun installSdkIfNeeded(sdk: Sdk, module: Module?, existingSdks: List<Sdk>, conte
/**
* Generic PySdkToInstall. Compatible with all OS / CpuArch.
*/
@Internal
class PySdkToInstall(val installation: BinaryInstallation)
: ProjectJdkImpl(installation.release.title, PythonSdkType.getInstance(), "", installation.release.version) {
@@ -49,6 +52,7 @@ class PySdkToInstall(val installation: BinaryInstallation)
* Customize [renderer], which is typically either [com.intellij.ui.ColoredListCellRenderer] or [com.intellij.ui.ColoredTreeCellRenderer].
*/
@CalledInAny
@Internal
fun renderInList(renderer: SimpleColoredComponent) {
renderer.append(name)
val preview = installation.toResourcePreview()