in ideaSupport/src/main/scala/org/jetbrains/sbtidea/download/plugin/RepoPluginInstaller.scala [75:104]
private[plugin] def isInstalledPluginUpToDate(plugin: IntellijPlugin)(implicit ctx: IdeInstallationContext): Boolean = {
val pluginRoot = localRegistry.getInstalledPluginRoot(plugin)
val descriptor = LocalPluginRegistry.extractInstalledPluginDescriptorFileContent(pluginRoot)
descriptor match {
case Left(error) =>
log.warn(s"Failed to extract descriptor from plugin $plugin: $error")
log.info(s"Up-to-date check failed, assuming plugin $plugin is out of date")
return false
case Right(data) =>
val descriptor = PluginDescriptor.load(data.content)
if (!isPluginCompatibleWithIdea(descriptor)) {
log.warn(s"Plugin $plugin is incompatible with current ideaVersion(${buildInfo.buildNumber}): $descriptor")
return false
}
plugin match {
case IntellijPlugin.Id(_, Some(version), _, _) if descriptor.version != version =>
log.info(s"Locally installed plugin $plugin has different version: ${descriptor.version} != $version")
return false
case IntellijPlugin.Id(_, None, channel, _) =>
getMoreUpToDateVersion(descriptor, channel) match {
case None =>
case Some(newVersion) =>
log.warn(s"Newer version of plugin $plugin is available: ${descriptor.version} -> $newVersion")
return false
}
case _ =>
}
}
true
}