Peter
Peter

Reputation: 940

IntelliJ IDEA is not finding Play Twirl templates (sometimes)

I'm developing a Play Java 2.4.x application that's pretty much following all the Play conventions.

When viewing the project in IntelliJ IDEA Ultimate, the Twirl templates are usually marked as "cannot resolve symbol" in the import statements. Sometimes and inexplicably (to me), they will show up ok.

I can ctrl-click on any of the templates and IDEA will show me the compiled Scala file. Even if they are marked as "cannot resolve"

For instance, this screenshot shows a few templates as ok, but others not: enter image description here

The templates are in /app/views/**.scala.html

Twirl compiles them to /target/scala-2.11/twirl/main/views/html/**.template.scala

And Scala compiles them to /target/scala-2.11/classes/views/html/**.class

I am running IntelliJ IDEA Ultimate 2016.3.4 with Playframework support plugin version 1.0

sbt run works perfectly fine on this project and has never complained about the missing templates.

Here is my sources configuration (most of that seems to be autogenerated, I've tried cleaning it up, but something keeps adding all the ones in red back in) enter image description here

Upvotes: 3

Views: 1658

Answers (1)

CrazyCoder
CrazyCoder

Reputation: 401935

There is an open bug which looks like your problem:

  • SCL-10578 2012.2: Cannot resolve symbol on twirl template import

Upvotes: 2

Related Questions