Child pages
  • Setting up Scala plugin project in IntelliJ IDEA
Skip to end of metadata
Go to start of metadata

UPDATE: Please see project Readme for setup instructions. You may also check our intro to the Scala plugin internals.

Here you can find complete guide how to start writing patches (or to creating your own Scala plugin builds) to IntelliJ IDEA Scala plugin.

  1. Checkout project: https://github.com/JetBrains/intellij-scala
  2. Pull requests is better to do for master branch, which is for IDEA 14.
  3. Call "sbt downloadIdea" from command line. It's approx. for 10 minutes.
    1. Sometimes you will need to call it again, when dependency to IDEA will be updated.
  4. Import sources as SBT project.
    1. In IntelliJ IDEA 14 choose File -> Import Project...
    2. Choose directory with your scala-plugin repository.
    3. Choose "Import project from external model" -> "SBT". Press Next.
    4. Choose Project SDK. Target SDK is 1.6, however sources are compatible with 1.7. Press Finish.
    5. Wait for the SBT process.
  5. Now you can make project. After that you can run IDEA run configuration.
  6. TypeInferenceTests run configuration is example. You should configure defaults for JUnit according to this example.
  7. You can use ScalaPlugin artifact to build plugin distribution.
  8. You also can compile, test and package plugin from sbt command line.
  • No labels

11 Comments

  1. I haven't been able to actually build the plugin on Cardea; for some reason I'm getting compilation errors with classes from the Runner module not found when compiling the ScalaCommunity module:

    I do see the compile dependency on the relevant module, and have hit kind of a brick wall on this (trying to resolve http://youtrack.jetbrains.com/issue/SCL-6468). Is there anyone I can connect with? I don't mind helping out in updating the documentation etc.

    1. Problem seems to have resolved itself in the interim.

      1. Sorry for late answer.

        I also saw this problem with SBT based compiler. It's ok with IntelliJ IDEA compiler. We will take a look for this bug to fix it. There are workaround to add Scala facet to all pure Java modules, but it's not necessary, because IntelliJ IDEA compiler is much faster (so it's better to use it instead). I'll check this page later again to modify according to changes.

        Best regards
        Alexander Podkhalyuzin.

  2. Also, number 8 on the list specifies what I guess are old artifact names; now it's just one artifact named ScalaPlugins.

  3. Hi,

    I want to modify Intellij Scala plugin. For that I am using
    this instruction. And got 18 compilation errors (see log bellow).

    Shorts comments on the instruction steps.
    2. Using remotes/origin/HEAD -> origin/master branch. It was like that
    after cloning.
    3. Using community edition 13.0.2.
    4. Using 1.7.0_51. Version of 1.6 doesn't have tools.jar on my mac.
    5. CARDEA_HOME: /Applications/IntelliJ IDEA 13 CE.app
    6. Receive mentioned errors after running "IDEA" configuration or
    executing build -> make project.

    OS: Mac Mavericks.

    Please help!

    ERROR LOG

    1. Hi,

      You are using wrong version of IDEA. Now it's good to try 13.1 branch with IDEA 13.1 RC2 (master is not actual right now, 13.1 branch will be merged to master a bit later after 13.1 release).

      Best regards
      Alexander Podkhalyuzin.

      1. Hi,

        Now it builds but all tests are failling with

        ERROR: Invalid home path '/Users/<username>/Library/Caches/IntelliJIdea13/plugins-sandbox/test'

        java.lang.RuntimeException: Invalid home path '/Users/<username>/Library/Caches/IntelliJIdea13/plugins-sandbox/test'

        I have correct CARDEA_HOME path variable. What else should I add?

        Thanks,
        Igor

  4. Hi Alexander,

    Is there an easy way to test Scala Plugin with IntelliJ Ultimate Edition?

    Cheers,

    Andrey

    1. You can put your downloaded IntelliJ IDEA Ultimate under SDK/ideaSDK/idea-%current.idea.build.number% instead of automatically downloaded community edition.

      Best regards,
      Alexander Podkhalyuzin.

  5. Hello Alexander,

    What version of SBT are you building with? When I run (in f92a7f388dee65dc5555c0af67b5dc9fc5c16034, which is master right now) `sbt downloadIdea` I get

    Best,
    Owen

    1. build.properties contains version 0.13.5.

      Best regards,
      Alexander Podkhalyuzin.