Can IntelliJ IDEA properly format scala.html files and how do I enable it to do so?

intellij-idea, playframework, scala

Solution

It's an open issue: http://youtrack.jetbrains.com/issue/SCL-5570

This answer needed more characters to meet the minimum, so here they are.

Problem

IntelliJ IDEA 12 Ultimate and CE format the following line in my main.scala.html file (in a Play application) ``` <link rel="stylesheet" media="screen" href="@routes.Assets.at("stylesheets/main.css")"> ``` As ``` <link rel="stylesheet" media="screen" href="@routes.Assets.at(" stylesheets /main.css")"> ``` Yes. really. It breaks up a quoted string. I understand it thinks the string ends after `at(`, but this is an incorrect interpretation of the code. Can IntelliJ correctly format this code? How do I enable/use that formatting?

Original source