From 92a861df0539c1ba8f1d5b100a1d89b165f0921e Mon Sep 17 00:00:00 2001 From: Morgan Bartholomew Date: Thu, 12 Feb 2026 16:50:10 +1000 Subject: [PATCH] PY-87740/PY-87763 type engine: ui features GitOrigin-RevId: c1ee6bd5e0e0e31af41dcb403bccecada40096b7 --- .../messages/PyBundle.properties | 10 ---------- .../psi/types/PyTypeInferenceCspSolver.kt | 1 + .../configuration/PyLspToolConfiguration.kt | 17 ++++++++++++----- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/python/pluginResources/messages/PyBundle.properties b/python/pluginResources/messages/PyBundle.properties index c701b9ca4fc5..dfd605072da0 100644 --- a/python/pluginResources/messages/PyBundle.properties +++ b/python/pluginResources/messages/PyBundle.properties @@ -229,16 +229,6 @@ settings.python.group.description=Configure key Python development s settings.python.tools.group.title=Tools settings.python.tools.group.description=Configure external Python tool settings. -# Type Engine Settings -configurable.PyTypeEngineConfigurable.display.name=Type Engine -configurable.PyTypeEngineConfigurable.engine.label=Type engine: -configurable.PyTypeEngineConfigurable.project.default=Project default -configurable.PyTypeEngineConfigurable.project.default.description=Use the project-level type engine setting for this module. -configurable.PyTypeEngineConfigurable.pycharm.description=A smart IDE type engine optimized for real world Python, including Django templates, SqlAlchemy models, and more. -configurable.PyTypeEngineConfigurable.pyrefly.description=Currently in Beta, Pyrefly provides fast and accurate type checking, with experimental support for Django and Pydantic. -configurable.PyTypeEngineConfigurable.ty.description=Currently in Beta, ty provides fast and accurate type checking designed to work well with untyped code. Supports advanced type analysis features. -configurable.PyTypeEngineConfigurable.open.settings=Type Engine Settings\u2026 - runcfg.autodetect.display_name=Autodetect runcfg.autodetect.parameters.group.name=Python test diff --git a/python/python-psi-impl/src/com/jetbrains/python/psi/types/PyTypeInferenceCspSolver.kt b/python/python-psi-impl/src/com/jetbrains/python/psi/types/PyTypeInferenceCspSolver.kt index d629c05a7d1a..85c28040d1ad 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/psi/types/PyTypeInferenceCspSolver.kt +++ b/python/python-psi-impl/src/com/jetbrains/python/psi/types/PyTypeInferenceCspSolver.kt @@ -528,6 +528,7 @@ private object ConstraintReducer { Variance.INFER_VARIANCE -> { UNREACHABLE() } + Variance.BIVARIANT -> {} } // success } diff --git a/python/src/com/jetbrains/python/externaltools/configuration/PyLspToolConfiguration.kt b/python/src/com/jetbrains/python/externaltools/configuration/PyLspToolConfiguration.kt index 69f3ebca2795..4bec3ac41704 100644 --- a/python/src/com/jetbrains/python/externaltools/configuration/PyLspToolConfiguration.kt +++ b/python/src/com/jetbrains/python/externaltools/configuration/PyLspToolConfiguration.kt @@ -6,7 +6,15 @@ import com.intellij.util.xmlb.XmlSerializerUtil import java.nio.file.Path import kotlin.io.path.Path -abstract class PyLspToolConfiguration> : PersistentStateComponent { +interface PyLspExecutionConfiguration { + var executableDiscoveryMode: ExecutableDiscoveryMode + var pathToExecutable: String + val executablePath: Path? get() = pathToExecutable.ifEmpty { null }?.let { Path(it) } + var sdkName: String +} + +abstract class PyLspToolConfiguration> : PersistentStateComponent, + PyLspExecutionConfiguration { open var enabled: Boolean = false var inspections: Boolean = true open var completions: Boolean? = null @@ -20,10 +28,9 @@ abstract class PyLspToolConfiguration> : P * `null` means: not supported */ open var documentation: Boolean? = null - var executableDiscoveryMode: ExecutableDiscoveryMode = ExecutableDiscoveryMode.INTERPRETER - var pathToExecutable: String = "" - val executablePath: Path? get() = pathToExecutable.ifEmpty { null }?.let { Path(it) } - var sdkName: String = DEFAULT_ENVIRONMENT + override var executableDiscoveryMode: ExecutableDiscoveryMode = ExecutableDiscoveryMode.INTERPRETER + override var pathToExecutable: String = "" + override var sdkName: String = DEFAULT_ENVIRONMENT final override fun getState(): State = this as State