I am using IDEA 13 with Play 2.2.1 and was doing the examples on the play site.
public static Result index() { return redirect(routes.Application.tasks())
I could solve the problem by marking the generated code directories as the "Sources" folder. Go to File -> Project Structure -> "root" module -> Sources.