سؤال

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!

هل كانت مفيدة؟

المحلول

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

نصائح أخرى

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top