private def resolveInstalledPluginPlugin()

in ideaSupport/src/main/scala/org/jetbrains/sbtidea/download/plugin/PluginResolver.scala [128:147]


  private def resolveInstalledPluginPlugin(pluginDependency: PluginDependency): PluginDescriptorAndArtifactResolveResult = {
    val pluginKey = pluginDependency.plugin
    val descriptor = localRegistry.getPluginDescriptor(pluginKey)
    descriptor match {
      case Right(descriptor) =>
        val originalRemotePlugin = pluginKey match {
          case withId: IntellijPlugin.WithKnownId if localRegistry.isDownloadedPlugin(withId) =>
            val downloadUrl = getPluginDownloadUrl(pluginDependency, withId)
            Option(RemotePluginArtifact(pluginDependency, downloadUrl))
          case _ =>
            None
        }

        val root = localRegistry.getInstalledPluginRoot(pluginKey)
        val artifact = LocalPlugin(pluginDependency, descriptor, root, originalRemotePlugin = originalRemotePlugin)
        Right((descriptor, artifact))
      case Left(error) =>
        Left(Seq(s"Cannot find installed plugin descriptor $pluginDependency: $error"))
    }
  }