8

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!

Jeff May
  • 457
  • 2
  • 16
  • Probably best to suggest this on the [IDEA issue tracker](http://youtrack.jetbrains.com). I also miss this feature. – 0__ May 18 '13 at 22:10
  • 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 May 19 '13 at 02:46

2 Answers2

2

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
Eugene Yokota
  • 94,654
  • 45
  • 215
  • 319
1

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 ;-)

Jack
  • 16,506
  • 19
  • 100
  • 167
  • I mentioned in the question that I tried this and got lots of errors. Do you know of a way to turn these off per file? – Jeff May Jun 24 '13 at 14:40
  • Apologies Jeff, I missed that. Unfortunately I only installed Idea quickly to see if I can help you, but have nuked it since. I use Scala-IDE. However, I did not notice Idea highlighting any errors, but I may have been in dreamland at the time :-p – Jack Jun 25 '13 at 00:47