Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    moglideveloper
    @moglideveloper
    there is a some documentation to add scala compiler option
    that I am not able to figure out
    and google results are not very helpful for "what is org.scala-tools.sxr"
    moglideveloper
    @moglideveloper

    @dhinojosa

    Whether IntelliJ will accept it or not will be a concern

    A confirmation on this, will be really helpful

    Daniel Hinojosa
    @dhinojosa
    It may be the simplest answer is don't create a src/main/scala and src/test/java folder.
    Your solution works, but it is rather "violent". If anyone tries to use src/main/scala they get an exception
    [error] scala.reflect.internal.MissingRequirementError: object scala in compiler mirror not found.
    [error] scala.reflect.internal.MissingRequirementError$.notFound(MissingRequirementError.scala:24)
    [error] scala.reflect.internal.Mirrors$RootsBase.$anonfun$getModuleOrClass$6(Mirrors.scala:66)
    [error] scala.reflect.internal.Mirrors$RootsBase.getPackage(Mirrors.scala:66)
    [error] scala.reflect.internal.Definitions$DefinitionsClass.ScalaPackage$lzycompute(Definitions.scala:196)
    [error] scala.reflect.internal.Definitions$DefinitionsClass.ScalaPackage(Definitions.scala:196)
    [error] scala.reflect.internal.Definitions$DefinitionsClass.ScalaPackageClass$lzycompute(Definitions.scala:197) | => mogli-dev / Compile / compileIncremental 11s
    image.png
    moglideveloper
    @moglideveloper
    As suggested I removed src/main/scala and src/test/java directories. Still support for scala is not visible in test sources
    image.png
    Daniel Hinojosa
    @dhinojosa
    I think you need still name and version in build.sbt
    I have scala in my tests just fine
    moglideveloper
    @moglideveloper
    added (build file corrected, reuploaded screenshot)
    image.png
    Daniel Hinojosa
    @dhinojosa
    Did you reload?
    image.png
    Click the "refresh" button so changes take effect
    image.png
    moglideveloper
    @moglideveloper
    yes i did. but I think, I am missing something
    uploaded my project here
    request you to please verfiy my build file
    Daniel Hinojosa
    @dhinojosa
    moglideveloper
    @moglideveloper
    it worked :)
    Thanks you so much @dhinojosa for all the help and time
    really appreciate
    Daniel Hinojosa
    @dhinojosa
    Yes, excellent!
    moglideveloper
    @moglideveloper
    I was missing scalaVersion := "2.13.5"
    Daniel Hinojosa
    @dhinojosa
    AHHHH
    Yes
    moglideveloper
    @moglideveloper
    intention was not to ship scala library accidentally in our final build package. That's why we were trying to enable scala in our test scope only
    what I understood so far that combination of
    //this will enable scala in complete project
    scalaVersion := "2.13.5"
    //this will disable scala
    autoScalaLibrary := false
    //and this will enable scala again in test scope
    libraryDependencies += "org.scala-lang" % "scala-library" % scalaVersion.value % "test"
    Daniel Hinojosa
    @dhinojosa
    If you get creative you can create custom tasks that would ensure there is no src/main/scala or src/test/java before you compile
    moglideveloper
    @moglideveloper
    my understanding was, even if scalaVersion is not defined, will be picked based on the sbt.version that is defined in build.properties
    Daniel Hinojosa
    @dhinojosa
    I think maybe IntelliJ requires name, version, scalaVersion at the very least
    moglideveloper
    @moglideveloper
    your solution really helped. but again, this is not clear why directly enabling scala library in test is not sufficient, when scala version is by default pulled from sbt version defined in build.properties
    //this will enable scala in complete project
    scalaVersion := "2.13.5"
    //this will disable scala
    autoScalaLibrary := false
    //and this will enable scala again in test scope
    libraryDependencies += "org.scala-lang" % "scala-library" % scalaVersion.value % "test"
    Daniel Hinojosa
    @dhinojosa
    Probably just how the IntelliJ Scala Plugin recognizes a Scala Project.
    Adding scala-libarary to the test scope only I would assume is very rare
    moglideveloper
    @moglideveloper
    ok. Thanks again @dhinojosa
    Ishan Shah
    @nullptr7
    Intellij attempts to download the scalafmt jars from the public internet and the firewall in our org doesn't allow that. We do have scalafmt within our internal maven repository though. Is there any way we can point the Scala plugin to use a local scalafmt jar, or tell it what maven repo to download it from? Thanks
    Eric Peters
    @er1c
    Is there a way to pass in a sbt arg like "testPreRelease" configuration into the ScalaTest intellij run config?
    image.png
    2 replies
    Eric Peters
    @er1c
    I also noticed that when running through sbt it runs each test suite one at a time, which also triggers code formatting checks we have and does recompiling each time (which seems odd) - e.g. [IJ]{file:/Users/eric/dd/bigdata-master/web_api/}web_api/ testOnly feature_factory_interfaces.output.SmallFeatureDescriptorSetSerializerTest how can I use the ScalaTest and just have it run the single testPreRelease
    4 replies
    Preston Marshall
    @bbhoss
    I'm just trying to open a project with the Scala plugin that uses sbt. No matter what I try I can't seem to get it to recognize that it's an actual sbt project. I "Opened as Project" to no avail. The scala plugin is installed and it's able to highlight code, but the sbt window doesn't appear. Any ideas?
    Preston Marshall
    @bbhoss
    blowing away .idea seems to fix :frowning:
    Dario Abdulrehman
    @dabd
    does anyone know how to add support for scalafix-organize-imports in IntelliJ?
    Dermot Haughey
    @hderms
    Is there any plan to make Intellij work with SBT under wsl2? I know they got it working with maven and gradle
    1 reply
    wangzaixiang
    @wangzaixiang
    the plugin can't support debug breakpoints on top-level method.
    2 replies
    Loup
    @loup-fox
    I have issues with the auto import feature since I started working with Scala3 both on Metal with VSCode and with Intellij. Does someone know why?
    Brian P. Holt
    @bpholt
    Is it possible to debug ScalaJS code running in NodeJS inside IntelliJ? I’m not sure how one would set up the run configuration for that.