in ideaSupport/src/main/scala/org/jetbrains/sbtidea/download/plugin/PluginResolver.scala [93:111]
private def resolvePluginByIdImpl(
plugin: PluginDependency,
key: IntellijPlugin.WithKnownId,
): PluginDescriptorAndArtifactResolveResult = {
val descriptor: Either[String, PluginDescriptor] = key match {
case IntellijPlugin.Id(id, _, channel, _) =>
repo.getRemotePluginXmlDescriptor(plugin.buildInfo, id, channel).left.map(_.toString)
case withCustomUrl: IntellijPlugin.IdWithDownloadUrl =>
downloadAndExtractDescriptor(withCustomUrl)
}
descriptor match {
case Right(descriptor) =>
val downloadUrl = getPluginDownloadUrl(plugin, key)
val artifact = RemotePluginArtifact(plugin, downloadUrl)
Right((descriptor, artifact))
case Left(error) =>
Left(Seq(s"Failed to resolve $plugin: $error"))
}
}