I'm using the Play Framework with Scala, developing using IntelliJ IDEA Community 13. I've got Play running from a terminal; that's all working. However, IntelliJ isn't recognizing some of the operators used on strings.
Here's my code:
package controllers
import play.api.mvc._
import play.api.libs.json._
object Application extends Controller {
def index = Action {
Redirect(routes.Application.tasks)
}
def tasks = TODO
def newTask = TODO
def deleteTask(id: Long) = TODO
def sayHello = Action(parse.json) { request =>
(request.body \ "name").asOpt[String].map { name =>
Ok(Json.toJson(
Map("status" -> "OK", "message" -> ("Hello " + name)) // this line
))
}.getOrElse {
BadRequest("Missing parameter [name]")
}
}
}
It compiles and runs fine in Play. However, IntelliJ marks the +
and ->
operators as invalid, giving me a "Cannot resolve symbol +
" when I hover.
I know this is more of an inconvenience than anything else, but it's really bothering me. What do I have to import or configure in order to get IntelliJ to recognize those operators?