Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 981
Jason Avatar asked Jul 03 '13 21:07

Jason


People also ask

Is IntelliJ IDEA good for HTML?

IntelliJ IDEA brings powerful support for HTML that includes syntax and error highlighting, formatting according to the code style, structure validation, code completion, on-the-fly preview during a debugging session (Live Edit) or in the dedicated preview tab in the code editor, and much more.

Can I use IntelliJ for HTML and CSS?

By default, IntelliJ IDEA shows on-the-fly preview only for HTML and CSS code. To enable Live Edit in JavaScript, select the JavaScript, HTML and CSS option.


1 Answers

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.

like image 175
James Ward Avatar answered Oct 01 '22 02:10

James Ward