10

Pretty straightforward: I'm allergic to Java but want to write a plugin for IntelliJ. Is this possible?

It wants me to set up a project SDK, but it only allows for Java SDKs, not Scala. Since they both run in JVM, I don't see why using Scala would be a problem.

sircodesalot
  • 11,231
  • 8
  • 50
  • 83
  • 1
    I won't pretend this is a real answer, but you could start by setting up an IDEA plug-in SDK project and then manually add a Scala facet and whatever library dependencies you need. Alternatively you can probably set up an SBT project that references the IDEA SDK JAR file(s?) as an unmanaged dependency. That would be my first attempt, since I find SBT and its IDEA project-generating plug-in indispensable and manually configuring IDEA projects *very* tedious. – Randall Schulz Jan 23 '14 at 02:58
  • 1
    you still need jdk to compile scala, scala library depends on standard java classes. btw, intellij-scala plugin is written in scala https://github.com/JetBrains/intellij-scala – Denis Tulskiy Jan 23 '14 at 03:56
  • Write your scala code and [embed it in the plugin loader for IDEA](http://stackoverflow.com/questions/3905948/how-do-i-embed-the-scala-2-8-interpreter-in-a-java-application)... Doesn't seem difficult to me. – hd1 Jan 23 '14 at 06:35

1 Answers1

16

Scala plugin for IntelliJ IDEA has 85% Scala code, so yes it's possible. You can take a look for our configuration: https://github.com/JetBrains/intellij-scala Together with setup description you will be able to setup plugin development for your plugin: http://confluence.jetbrains.com/display/SCA/Setting+up+Scala+plugin+project+in+IntelliJ+IDEA

Chris Martin
  • 30,334
  • 10
  • 78
  • 137
Alefas
  • 3,084
  • 1
  • 16
  • 7