67726e / Spring-MVC-Twirl

Twirl templates for Spring MVC
MIT License
7 stars 1 forks source link

Determine Usage with IntelliJ #2

Open 67726e opened 9 years ago

67726e commented 9 years ago

Figure out how to get syntax highlighting with IntelliJ. Things like the constructor @(body: Html) are presently highlighted as errors because IntelliJ cannot resolve the class Html. We also have import/resolution issues when using sibling templates.

With the structure and code presented below, we receive a syntax error indicating that base is not resolved inside of index.

twirl/base.scala.html
twirl/index.scala.html
@* base.scala.html *@
@(title: String)(body: Html)
<div>@body</div>
@* index.scala.html *@
@()
@* body highlights as an error *@
@body("Title") {
  <h2>Hello, World</h2>
}