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

Document how to use this plugin effectively with IntelliJ #60

Open
kflorence opened this issue Aug 9, 2021 · 2 comments
Open

Document how to use this plugin effectively with IntelliJ #60

kflorence opened this issue Aug 9, 2021 · 2 comments

Comments

@kflorence
Copy link

I love what this plugin provides, but I'm struggling to use it with IntelliJ. We have it set up here https://github.com/jbwheatley/pact4s to provide support for Java 8 and Java 11, however, when I load the project in IntelliJ it will load the Java 8 dependencies everywhere, which makes development against Java 11 difficult. Are there workarounds or settings that make IntelliJ support better?

I see: https://intellij-support.jetbrains.com/hc/en-us/community/posts/360008744360-Configuring-the-Scala-plugin-so-that-only-a-subset-of-projects-is-imported

Perhaps we need to configure "views" for the project, where we can select one view at a time during development? In any case, it would be nice to document this so it's easier for people to use this plugin.

@ohze
Copy link

ohze commented Oct 21, 2021

I have other simple-and-common use case:
unmanagedSourceDirectories don't work with Intellij (question on stackoverflow)

// build.sbt
val foo = projectMatrix
  .jvmPlatform(Seq("2.13.6", "2.12.15"))
  .settings(
    Compile / unmanagedSourceDirectories += (ThisBuild / baseDirectory).value / "shared"
  )

// foo/src/main/scala/Foo.scala
object Foo {
  val s = "foo"
  def sharedS = Shared.s
}

// shared/Shared.scala
object Shared {
  val s = "shared"
  def fooS = Foo.s
}

Intellij don't know Shared.s in Foo.scala (it mark Shared red with error "Cannnot resolve symbol Shared") and don't know Foo.s in Shared.scala
😢

EDIT: Sorry. I have just found that this issue don't related to sbt-projectmatrix: Replace projectMatrix by project in build.sbt => same problem

@nafg
Copy link

nafg commented Jan 16, 2022

I'm also having an issue with unmanagedSourceDirectories not being recognized by IntelliJ, I'm pretty sure only since I switched to sbt-projectmatrix

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

No branches or pull requests

3 participants