Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Syntax highlighting for *.sbt files in IntelliJ IDEA

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!

like image 894
Jeff May Avatar asked May 18 '13 18:05

Jeff May


2 Answers

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
like image 151
Eugene Yokota Avatar answered Sep 20 '22 15:09

Eugene Yokota


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

like image 43
Jack Avatar answered Sep 21 '22 15:09

Jack