Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where does sbt-idea-plugin put source code for external plugins? #54

Closed
maseev opened this issue Mar 14, 2020 · 8 comments
Closed

Where does sbt-idea-plugin put source code for external plugins? #54

maseev opened this issue Mar 14, 2020 · 8 comments
Assignees

Comments

@maseev
Copy link

maseev commented Mar 14, 2020

My build.sbt file looks like the following:

intellijPluginName in ThisBuild := "my-plugin"
intellijBuild in ThisBuild := "2019.3.3"
intellijExternalPlugins += "org.intellij.scala:2019.3.720:Nightly".toPlugin

name := "my-plugin"

version := "0.1"

scalaVersion := "2.13.1"

plugins.sbt:

resolvers += Resolver.url("jetbrains-sbt", url(s"https://dl.bintray.com/jetbrains/sbt-plugins"))(Resolver.ivyStylePatterns)

addSbtPlugin("org.jetbrains" % "sbt-idea-plugin" % "3.5.0")

sbt-idea-plugin was able to download the IntelliJ Platform SDK and Scala plugin.

Unfortunately, I was only able to find source code for the IntelliJ Platform SDK (it was downloaded to /home/my-plugin/sdk/2019.3.3/sources.zip and I had to manually set this folder as a source folder inside the IDE) but not for the Scala plugin.

Right now it looks like sbt-idea-plugin doesn't download source code for external plugins.

@maseev
Copy link
Author

maseev commented Mar 15, 2020

After the restart, the IDE was able to pick up the source code for the Scala plugin automatically.

@maseev maseev closed this as completed Mar 15, 2020
@mutcianm
Copy link
Collaborator

Hm, sbt-idea-plugin indeed does not download sources of the plugins from the plugin repo at the moment, but it's a reasonable feature request.
I'm not completely sure why the IDE was able to pick up the source code for the Scala plugin.

@mutcianm mutcianm reopened this Mar 15, 2020
@mutcianm mutcianm self-assigned this Mar 15, 2020
@maseev
Copy link
Author

maseev commented Mar 16, 2020

I completely forgot that I ended up downloading the source code for the Scala plugin myself by cloning the GitHub repo and setting the source code root inside the IDE.

@maseev
Copy link
Author

maseev commented Mar 16, 2020

I've got zio-intellij imported in IntelliJ IDEA and I can access the source code of the Java plugin but not the Scala plugin source code. Something tells me that the Scala plugin comes without any source code when you specify it as a plugin you depend on in your build configuration. zio-intellij uses gradle-intellij-plugin

@mutcianm
Copy link
Collaborator

The Java plugin is a bundled plugin(distributed as a part of IJ IDEA) - therefore its sources are a part of sources.zip which comes with IJ IDEA distribution.
External plugins are downloaded from IJ plugin marketplace which only contains binary artifacts with no sources.

@mutcianm
Copy link
Collaborator

Extracted this into a dedicated issue #55

@maseev
Copy link
Author

maseev commented Mar 16, 2020

For some reason I can't see the source code for the IntelliJ platform when I use the sbt-idea-plugin, but I can navigate through the same classes in a project which uses the gradle-intellij-plugin - meaning the IDE picks up the sources automatically. Does it have anything to do with the folder to which the sbt-idea-plugin downloads the IntelliJ SDK?

@mutcianm
Copy link
Collaborator

the most recent nightly build of Scala plugin should be able to attach IJ sources automatically if sbt-idea-plugin is enabled in the sbt build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants