Syntax highlighting for * .sbt files in IntelliJ IDEA

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

I have an sbt-idea plugin for sbt that successfully creates an IDEA project. I also have a sbt plugin for IDEA that allows me to run sbt commands from Run Configurations in IDEA.

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

Does anyone work on a * .sbt file type for syntax highlighting or code recognition? If so, how to use it?

Thanks!

+8
scala intellij-idea syntax-highlighting sbt sbt-idea
source share
2 answers

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

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

  • Import SBT Project
  • Auto Import SBT Projects
  • Allocation for .sbt files
+2
source share

Keep in mind that .sbt files are really Scala in some way (a string of required blank lines), so linking .sbt files with the Scala editor should not be so far from the syntax highlighting.

Open file → Settings → IDE Settings → File Types. Associate * .sbt with Scala. This is not an ideal, but a beginning. At least the editor will look a little better :-)

+1
source share

All Articles