diff --git a/idea/src/org/jetbrains/kotlin/idea/KotlinPluginUpdater.kt b/idea/src/org/jetbrains/kotlin/idea/KotlinPluginUpdater.kt index 634f2f91ff3..c4af83edb02 100644 --- a/idea/src/org/jetbrains/kotlin/idea/KotlinPluginUpdater.kt +++ b/idea/src/org/jetbrains/kotlin/idea/KotlinPluginUpdater.kt @@ -336,6 +336,11 @@ class KotlinPluginUpdater(private val propertiesComponent: PropertiesComponent) private class PluginDTO { var cdate: String? = null var channel: String? = null + // `true` if the version is seen in plugin site and available for download. + // Maybe be `false` if author requested version deletion. + var listed: Boolean = true + // `true` if version is approved and verified + var approve: Boolean = true } @Throws(IOException::class, ResponseParseException::class) @@ -352,7 +357,10 @@ class KotlinPluginUpdater(private val propertiesComponent: PropertiesComponent) throw ResponseParseException("Can't parse json response", syntaxException) } - val selectedPluginDTO = pluginDTOs.singleOrNull { it.channel == channel || (it.channel == "" && channel == null) } + val selectedPluginDTO = pluginDTOs + .firstOrNull { + it.listed && it.approve && (it.channel == channel || (it.channel == "" && channel == null)) + } ?: return null val dateString = selectedPluginDTO.cdate ?: throw ResponseParseException("Empty cdate")