8
votes

I'm working on a potential module for the Lift Web framework using Scala, SBT 0.12, and IntelliJ IDEA 12.1, and I would like to have syntax highlighting for *.sbt files in IDEA (code awareness would be a bonus).

I have the sbt-idea plugin for sbt which successfully builds my IDEA project. I also have the sbt plugin for IDEA, which allows me to run sbt commands from Run Configurations in IDEA.

When I associate *.sbt files with the Scala file type, IDEA shows all kinds of errors in the sbt script.

Is anyone working on an *.sbt file type for syntax highlighting or code awareness? If so, how do I use it?

Thanks!

2
Probably best to suggest this on the IDEA issue tracker. I also miss this feature.0__
To my knowledge IDEA team is working on full support of sbt build definitions (so you can throw away sbt-idea plugin and work with sbt files in the same way you could work with maven -- no explicit regeneration on change and so on) and promised to roll out this feature soon (original date was late april, but looks like it is detained a little bit). I'm pretty sure highlighting will be the part of that feature, just wait for some (I hope not so long) time.om-nom-nom

2 Answers

2
votes

Scala plugin for IntelliJ IDEA 13 comes with highlighting for .sbt files. See Built-in SBT Support in IntelliJ IDEA 13:

Today we are happy to announce that the built-in support for SBT projects is finally here. The newest version of Scala plugin for IntelliJ IDEA 13 (0.23.308) comes with the following list of features:

  • Import SBT project
  • Auto-import SBT projects
  • Highlighting for .sbt files
1
votes

Keep in mind that .sbt files are really Scala in a way (bar the required blank lines), so associating .sbt files with the Scala editor should not be that far off with regard to syntax highlighting.

Open File -> Settings -> IDE Settings -> File Types. Associate *.sbt with Scala. It's not ideal but a start. At least the editor will look a bit better ;-)