Giter Club home page Giter Club logo

Comments (5)

SrodriguezO avatar SrodriguezO commented on June 5, 2024

Hey @joprice you shouldn't have to include the Scala standard library as a dependency. How are you binding default_scala in your WORKSPACE?

Also, what version of the IntelliJ plugin are you using?

from rules_scala.

joprice avatar joprice commented on June 5, 2024

I am using Intelij 2019.2.4 and Bazel plugin 2019.11.14.0.1. I'm configuring it like this:

bind(
    name = "default_scala",
    actual = "@rules_scala_annex//src/main/scala:zinc_2_12_8",
)

from rules_scala.

SrodriguezO avatar SrodriguezO commented on June 5, 2024

I've seen this issue when a custom ScalaConfiguration doesn't include the Scala compiler in its compiler_classpath, but the default one does so that's not it..

It might be that the IntelliJ plugin doesn't recognize it if it's coming from an external source. If that's the case, then specifying your own ScalaConfiguration in your workspace as explained here might be the way to go (although that'd be unfortunate because it'd mean the experience when using the default isn't great :/) simpler workaround in next comment

from rules_scala.

SrodriguezO avatar SrodriguezO commented on June 5, 2024

I poked around a bit more. This is an odd bug. If @annex//:org_scala_lang_scala_library or @annex//:org_scala_lang_scala_compiler are included as deps or runtime_deps on any Scala target in your workspace, IntelliJ recognizes things correctly everywhere, even if that target's not used.

Specifying your own ScalaConfiguration would make the issue go away because it specifies a scala_library with these deps, but a simpler work around would be to add a dummy rule somewhere.

e.g.

scala_binary(
    name = "fooNotUsed",
    runtime_deps = ["@annex//:org_scala_lang_scala_library"],
)

from rules_scala.

joprice avatar joprice commented on June 5, 2024

I'm also having this issue when using multiple scala versions, and the workaround doesn't seem to help. I have some projects on 2.12 and others on 2.11. Both projects seem to think they have some scala version available, as I can jump to source, but there is always a banner up top saying "No Scala SDK in module". When clicking Setup Scala SDK, it offers an incorrect version from the local ivy cache. For scala 2.12 projects, newer features like Future.unit are red since it's validating against an older version of scala. I would expect in the latter case for it to be broken as before, but it looks like it's using some global version.

from rules_scala.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.