Problem with Play 2 Scala templates

I'm finding that IDEA doesn't understand changes to Scala templates. For example, suppose I have index.html.scala with this:

@(message: String)

And my controller calls it using:

return ok(index.render("Your new application is ready."));

And then I change the template to be:

@(message: String, foo: String)

And the controller to be:

return ok(index.render("Your new application is ready.", "foo"));

I'm finding that IDEA will mark the controller code as red, claiming that I have an extra argument ("foo") that I shouldn't have. It isn't until I hit the page and Play recompiles the template that the error highlighting goes away.

Of course, this is a big problem because the whole point of IDEA's excellent syntax highlighting is to allow me to ensure my code is good before I load up the browser. The way the current behavior works, my flow is code->reload->check errors instead of the preferred code->check errors->reload.

Anyone else experiencing this?

1 comment
Comment actions Permalink

The best thing I've found so far is to open the play console on the command line and run the ~compile command. Then at least the recompile happens when the files change, though it's still not the experience I expect from IDEA.


Please sign in to leave a comment.