Ensure that reverse routing works with vanilla play idea from Java project in IntelliJ #969

Closed
jroper opened this Issue Apr 8, 2013 · 49 comments

Comments

Projects
None yet
@jroper
Member

jroper commented Apr 8, 2013

In a Java project, IntelliJ seems to consider reverse routes as syntax errors in.

@ghost ghost assigned nraychaudhuri Apr 15, 2013

@nraychaudhuri

This comment has been minimized.

Show comment
Hide comment
@nraychaudhuri

nraychaudhuri Apr 15, 2013

Collaborator

What is the exact problem? I can open a plain play-java project into idea and access the reverse routing without problem. But I see some other problems:

  • routes.java shows error
  • ok(index.render(...)) also shows an error. I am surprised by this one.
Collaborator

nraychaudhuri commented Apr 15, 2013

What is the exact problem? I can open a plain play-java project into idea and access the reverse routing without problem. But I see some other problems:

  • routes.java shows error
  • ok(index.render(...)) also shows an error. I am surprised by this one.
@jroper

This comment has been minimized.

Show comment
Hide comment
@jroper

jroper Apr 17, 2013

Member

I just happened to notice this too (the original request I made was for someone else).

It seems that IntelliJ 12.1 isn't able to infer the return type of Scala methods invoked from Java code if they return a generic type.

Member

jroper commented Apr 17, 2013

I just happened to notice this too (the original request I made was for someone else).

It seems that IntelliJ 12.1 isn't able to infer the return type of Scala methods invoked from Java code if they return a generic type.

@nraychaudhuri

This comment has been minimized.

Show comment
Hide comment
@nraychaudhuri

nraychaudhuri Apr 24, 2013

Collaborator

The reason that the controller is complaining because the project is not compiled hence no reverse route files generated. So if you compile the project before opening in the IDE that error should go away. The second problem is if you try to build the project it fails because we don't add Scala Facet for Java projects. I think the proper fix for this should be to run the compile task before generating the IDEA project files automatically(we do that for eclipse) and add the Scala facet for both Scala and Java projects.

The problem is there is no mechanism to assign preTasks for SbtIdeaPlugin and I cannot find a way to hook into the "idea" command. So for the time being we can add the Scala facet and mention in the docs to run compile to fix any additional compilation problems. Thoughts?

Collaborator

nraychaudhuri commented Apr 24, 2013

The reason that the controller is complaining because the project is not compiled hence no reverse route files generated. So if you compile the project before opening in the IDE that error should go away. The second problem is if you try to build the project it fails because we don't add Scala Facet for Java projects. I think the proper fix for this should be to run the compile task before generating the IDEA project files automatically(we do that for eclipse) and add the Scala facet for both Scala and Java projects.

The problem is there is no mechanism to assign preTasks for SbtIdeaPlugin and I cannot find a way to hook into the "idea" command. So for the time being we can add the Scala facet and mention in the docs to run compile to fix any additional compilation problems. Thoughts?

@jroper

This comment has been minimized.

Show comment
Hide comment
@jroper

jroper Apr 29, 2013

Member

It seems to be more than this. I had the scala facet enabled (I think), and I still get the highlighting error. In a Scala project it seems to work, but the routes.java generated file has errors in it. I think this is actually caused by an IntelliJ issue.

Member

jroper commented Apr 29, 2013

It seems to be more than this. I had the scala facet enabled (I think), and I still get the highlighting error. In a Scala project it seems to work, but the routes.java generated file has errors in it. I think this is actually caused by an IntelliJ issue.

@seantbrady

This comment has been minimized.

Show comment
Hide comment
Contributor

seantbrady commented May 2, 2013

@NIA

This comment has been minimized.

Show comment
Hide comment
@NIA

NIA May 6, 2013

It seems like on my machine this only affects routes.javascript.* and routes.ref.*. It can be easily seen when opening generated file target/scala-2.10/src_managed/main/controllers/routes.java in IDEA:

screen38

  • The first part of it is OK, and IDEA can easily navigate to definition of controllers.ReverseApplication, for example, which is in another generated file target/scala-2.10/src_managed/main/routes_reverseRouting.scala
  • The second and third part (javascript and ref) have all class names painted in red as syntax errors: IDEA cannot find classes like new controllers.javascript.ReverseApplication, while actually they are in the same routes_reverseRouting.scala file

So, my hypothesis is: might the issue be caused by the fact that many packages and classes are defined in the single Scala file routes_reverseRouting.scala? This indeed might be a known limitation of Scala-plugin of IntelliJ: if we do open this routes_reverseRouting.scala and navigate to any package xxx line in it, we will see it highlighted with a honest warning: "Package names doesn't correspond to directories structure, this may cause problems with resolve to classes from this file"

Not sure about how to solve this, but can we synchronize folder structure with package structure here? The file routes.java already lays in controller folder, and is treated well by IDEA, so probably routes_reverseRouting.scala can be split into three files ant put under this folder, too?

NIA commented May 6, 2013

It seems like on my machine this only affects routes.javascript.* and routes.ref.*. It can be easily seen when opening generated file target/scala-2.10/src_managed/main/controllers/routes.java in IDEA:

screen38

  • The first part of it is OK, and IDEA can easily navigate to definition of controllers.ReverseApplication, for example, which is in another generated file target/scala-2.10/src_managed/main/routes_reverseRouting.scala
  • The second and third part (javascript and ref) have all class names painted in red as syntax errors: IDEA cannot find classes like new controllers.javascript.ReverseApplication, while actually they are in the same routes_reverseRouting.scala file

So, my hypothesis is: might the issue be caused by the fact that many packages and classes are defined in the single Scala file routes_reverseRouting.scala? This indeed might be a known limitation of Scala-plugin of IntelliJ: if we do open this routes_reverseRouting.scala and navigate to any package xxx line in it, we will see it highlighted with a honest warning: "Package names doesn't correspond to directories structure, this may cause problems with resolve to classes from this file"

Not sure about how to solve this, but can we synchronize folder structure with package structure here? The file routes.java already lays in controller folder, and is treated well by IDEA, so probably routes_reverseRouting.scala can be split into three files ant put under this folder, too?

@NIA

This comment has been minimized.

Show comment
Hide comment
@NIA

NIA May 6, 2013

Haha, even simpler workaround: I created empty directories javascript and ref under the controllers directory on the picture, and IDEA got it. Syntax errors both in routes.java and my controller disappeared, and completion works. So scala plugin actually can handle package structure not similar to directory structure, but stumbles over the names of packages that is not known to it.

NIA commented May 6, 2013

Haha, even simpler workaround: I created empty directories javascript and ref under the controllers directory on the picture, and IDEA got it. Syntax errors both in routes.java and my controller disappeared, and completion works. So scala plugin actually can handle package structure not similar to directory structure, but stumbles over the names of packages that is not known to it.

@kamilafsar

This comment has been minimized.

Show comment
Hide comment
@kamilafsar

kamilafsar Aug 2, 2013

I'm running a Scala project and actually have the same problem. It looks like my controllers don't have any methods defined (apart from those derived from java.lang.Object).

I'm running a Scala project and actually have the same problem. It looks like my controllers don't have any methods defined (apart from those derived from java.lang.Object).

@ghost ghost assigned huntc Aug 30, 2013

@huntc

This comment has been minimized.

Show comment
Hide comment
@huntc

huntc Aug 30, 2013

Collaborator

I'm unable to reproduce this issue with IntelliJ 12.1.4 and the Scala plugin 0.16.293. Please note that I also have the Play 2.0 Support plugin from JetBrains: 0.16.294

Collaborator

huntc commented Aug 30, 2013

I'm unable to reproduce this issue with IntelliJ 12.1.4 and the Scala plugin 0.16.293. Please note that I also have the Play 2.0 Support plugin from JetBrains: 0.16.294

@huntc huntc closed this Aug 30, 2013

@andrewboss

This comment has been minimized.

Show comment
Hide comment
@andrewboss

andrewboss Oct 6, 2013

Exactly the same problem. IDEA 12.1.5 can't recognise controller methods from reverse routing. Tried recompiling and creating ref and javascript folders.

Exactly the same problem. IDEA 12.1.5 can't recognise controller methods from reverse routing. Tried recompiling and creating ref and javascript folders.

@OlegYch

This comment has been minimized.

Show comment
Hide comment
@OlegYch

OlegYch Oct 26, 2013

Contributor

this is still an issue even for scala projects with latest intellij-scala plugin and play 2.2.1-RC1

Contributor

OlegYch commented Oct 26, 2013

this is still an issue even for scala projects with latest intellij-scala plugin and play 2.2.1-RC1

@huntc

This comment has been minimized.

Show comment
Hide comment
@huntc

huntc Dec 4, 2013

Collaborator

@OlegYch Including IntelliJ 13?

Collaborator

huntc commented Dec 4, 2013

@OlegYch Including IntelliJ 13?

@OlegYch

This comment has been minimized.

Show comment
Hide comment
@OlegYch

OlegYch Dec 5, 2013

Contributor

On Thursday, December 5, 2013 2:52:23 AM, Christopher Hunt wrote:

@OlegYch https://github.com/OlegYch Including IntelliJ 13?


Reply to this email directly or view it on GitHub
#969 (comment).

yep
with sbt-idea 1.6.0-SNAPSHOT non of reverse routes resolve
with play idea only regular routes resolve http://prntscr.com/28s1g5
this is using idea 133.193 (13 final) and scala/play plugins v 0.26.319

Thanks, Aleh

Contributor

OlegYch commented Dec 5, 2013

On Thursday, December 5, 2013 2:52:23 AM, Christopher Hunt wrote:

@OlegYch https://github.com/OlegYch Including IntelliJ 13?


Reply to this email directly or view it on GitHub
#969 (comment).

yep
with sbt-idea 1.6.0-SNAPSHOT non of reverse routes resolve
with play idea only regular routes resolve http://prntscr.com/28s1g5
this is using idea 133.193 (13 final) and scala/play plugins v 0.26.319

Thanks, Aleh

@huntc

This comment has been minimized.

Show comment
Hide comment
@huntc

huntc Dec 5, 2013

Collaborator

The IntelliJ issue remains open so I think we can keep this as closed for now.

Collaborator

huntc commented Dec 5, 2013

The IntelliJ issue remains open so I think we can keep this as closed for now.

@TomasLinhart

This comment has been minimized.

Show comment
Hide comment
@TomasLinhart

TomasLinhart Dec 11, 2013

Why don't you just generate ref and javascript folders to workaround it?

Why don't you just generate ref and javascript folders to workaround it?

@jroper

This comment has been minimized.

Show comment
Hide comment
@jroper

jroper Dec 12, 2013

Member

Sure, add this to your build:

sourceGenerators in Compile <+= sourceManaged in Compile map { dir: File =>
  val dirs = Seq(dir / "ref", dir / "javascript")
  dirs.foreach(_.mkdirs)
  dirs
}
Member

jroper commented Dec 12, 2013

Sure, add this to your build:

sourceGenerators in Compile <+= sourceManaged in Compile map { dir: File =>
  val dirs = Seq(dir / "ref", dir / "javascript")
  dirs.foreach(_.mkdirs)
  dirs
}
@tjjalava

This comment has been minimized.

Show comment
Hide comment
@tjjalava

tjjalava Dec 12, 2013

I think that should be:

val dirs = Seq(dir / "main" / "controllers" / "ref", dir / "main" / "controllers" / "javascript")

right?

Anyways, compilation ends in error:

[error] source file '.../target/scala-2.10/src_managed/main/controllers/javascript' could not be found

I think that should be:

val dirs = Seq(dir / "main" / "controllers" / "ref", dir / "main" / "controllers" / "javascript")

right?

Anyways, compilation ends in error:

[error] source file '.../target/scala-2.10/src_managed/main/controllers/javascript' could not be found
@TomasLinhart

This comment has been minimized.

Show comment
Hide comment
@TomasLinhart

TomasLinhart Dec 12, 2013

Yeah, it doesn't work.

Yeah, it doesn't work.

@OlegYch

This comment has been minimized.

Show comment
Hide comment
@OlegYch

OlegYch Jan 16, 2014

Contributor

this should work

    sourceGenerators in Compile += task {
      val dir: File = (sourceManaged in Compile).value / "controllers"
      val dirs = Seq(dir / "ref", dir / "javascript")
      dirs.foreach(_.mkdirs)
      Seq[File]()
    }
Contributor

OlegYch commented Jan 16, 2014

this should work

    sourceGenerators in Compile += task {
      val dir: File = (sourceManaged in Compile).value / "controllers"
      val dirs = Seq(dir / "ref", dir / "javascript")
      dirs.foreach(_.mkdirs)
      Seq[File]()
    }
@OlegYch

This comment has been minimized.

Show comment
Hide comment
@OlegYch

OlegYch Jan 16, 2014

Contributor

why is that so hard to release?
should every user be workarounding issues like this and #1784 ?

Contributor

OlegYch commented Jan 16, 2014

why is that so hard to release?
should every user be workarounding issues like this and #1784 ?

@m242

This comment has been minimized.

Show comment
Hide comment
@m242

m242 Jan 21, 2014

Contributor

Easier fix-- unmark "controllers" and "views" as source roots in IntelliJ, and mark "main" as a source root. That fixes syntax highlighting/completion/etc.

Contributor

m242 commented Jan 21, 2014

Easier fix-- unmark "controllers" and "views" as source roots in IntelliJ, and mark "main" as a source root. That fixes syntax highlighting/completion/etc.

@Kwestor

This comment has been minimized.

Show comment
Hide comment
@Kwestor

Kwestor Jan 21, 2014

+10 (1 for each module in which I have to change it manually)

Kwestor commented Jan 21, 2014

+10 (1 for each module in which I have to change it manually)

@huntc

This comment has been minimized.

Show comment
Hide comment
@huntc

huntc Jan 21, 2014

Collaborator

Please note that http://youtrack.jetbrains.com/issue/SCL-5635 remains open. If you feel we can work around this then please open an associated PR. Thanks.

Collaborator

huntc commented Jan 21, 2014

Please note that http://youtrack.jetbrains.com/issue/SCL-5635 remains open. If you feel we can work around this then please open an associated PR. Thanks.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Feb 9, 2014

I found the solution to this issue by changing the source paths in the Module Settings of the IDEA project as explained here:
http://www.jensjaeger.com/2013/09/play-framework-2-2-in-intellij-errors-in-controllers-everywhere/

ghost commented Feb 9, 2014

I found the solution to this issue by changing the source paths in the Module Settings of the IDEA project as explained here:
http://www.jensjaeger.com/2013/09/play-framework-2-2-in-intellij-errors-in-controllers-everywhere/

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Jul 5, 2014

This is an issue with sbt-idea. The workaround is to unmark the controllers directory (e.g. target/scala-2.11/src_managed/main/controllers) as a source root, and mark the main folder (e.g. target/scala-2.11/src_managed/main) as a source root. Then IntelliJ will find everything properly. This really should be fixed, either by changing where Play puts the compiled routes files (since sbt-idea expects everything to be put into subfolders within compile:managedSources), or to submit this as a bug in sbt-idea.

ghost commented Jul 5, 2014

This is an issue with sbt-idea. The workaround is to unmark the controllers directory (e.g. target/scala-2.11/src_managed/main/controllers) as a source root, and mark the main folder (e.g. target/scala-2.11/src_managed/main) as a source root. Then IntelliJ will find everything properly. This really should be fixed, either by changing where Play puts the compiled routes files (since sbt-idea expects everything to be put into subfolders within compile:managedSources), or to submit this as a bug in sbt-idea.

@jroper

This comment has been minimized.

Show comment
Hide comment
@jroper

jroper Jul 8, 2014

Member

The bug is in sbt-idea. Play must put the compiled routes files in src_managed/main, because one of the generated files is a Java file, and the Java compiler requires that the folder structure matches the package structure, and SBT uses src_managed/main as the root folder for Java compilation. So the controllers.routes class must be in src_managed/main/controllers/routes.java, anything else and javac produces a compile error.

Note though that in master (Play 2.4), we're now using a completely different directory outside of src_managed, which I guess will make this issue go away.

Member

jroper commented Jul 8, 2014

The bug is in sbt-idea. Play must put the compiled routes files in src_managed/main, because one of the generated files is a Java file, and the Java compiler requires that the folder structure matches the package structure, and SBT uses src_managed/main as the root folder for Java compilation. So the controllers.routes class must be in src_managed/main/controllers/routes.java, anything else and javac produces a compile error.

Note though that in master (Play 2.4), we're now using a completely different directory outside of src_managed, which I guess will make this issue go away.

@m242

This comment has been minimized.

Show comment
Hide comment
@m242

m242 Jul 8, 2014

Contributor

Note that this is kind of a non-issue with IntelliJ 13 and the updated SBT support. Reverse routing support gets automatically picked up.

Contributor

m242 commented Jul 8, 2014

Note that this is kind of a non-issue with IntelliJ 13 and the updated SBT support. Reverse routing support gets automatically picked up.

@moreindirection

This comment has been minimized.

Show comment
Hide comment
@moreindirection

moreindirection Nov 5, 2014

@NIA's workaround works even in IntelliJ IDEA 14.

@NIA's workaround works even in IntelliJ IDEA 14.

@cdraeger

This comment has been minimized.

Show comment
Hide comment
@cdraeger

cdraeger Nov 17, 2014

Contributor

This issue is very very confusing and I'm surprised it still hasn't been fixed. Yes, NIAs workaround works, but it took me quite some time until I found this issue. So for the sake of any future Play Java dev (and the chance is high they are using IntelliJ Idea), I really hope it'll go away with Play 2.4.

Contributor

cdraeger commented Nov 17, 2014

This issue is very very confusing and I'm surprised it still hasn't been fixed. Yes, NIAs workaround works, but it took me quite some time until I found this issue. So for the sake of any future Play Java dev (and the chance is high they are using IntelliJ Idea), I really hope it'll go away with Play 2.4.

@milanaleksic

This comment has been minimized.

Show comment
Hide comment
@milanaleksic

milanaleksic Mar 25, 2015

This is still going on in latest Intellij 14.1; NIAs workaround is still OK

This is still going on in latest Intellij 14.1; NIAs workaround is still OK

@sunnykaka

This comment has been minimized.

Show comment
Hide comment
@sunnykaka

sunnykaka Apr 2, 2015

I put @OlegYch 's answer in my Build.scala and reload the project.
My Intellij still not include "target/scala-2.11/src_managed/main" as source folder.
here is my Build.scala:
screenshot from 2015-04-02 15 23 10

So I have to add source folder manually every time after project reload : (

I put @OlegYch 's answer in my Build.scala and reload the project.
My Intellij still not include "target/scala-2.11/src_managed/main" as source folder.
here is my Build.scala:
screenshot from 2015-04-02 15 23 10

So I have to add source folder manually every time after project reload : (

@kflorence

This comment has been minimized.

Show comment
Hide comment
@kflorence

kflorence Apr 29, 2015

Contributor

FWIW, none of these solutions work for me with Play 2.3.8 and IJ 14.1.x :(

Contributor

kflorence commented Apr 29, 2015

FWIW, none of these solutions work for me with Play 2.3.8 and IJ 14.1.x :(

@bpgriner

This comment has been minimized.

Show comment
Hide comment
@bpgriner

bpgriner May 16, 2015

I'm not sure if this is the same problem, but when trying to perform a return redirect(routes.Application.index());, routes is not a known variable that can used.

I'm attempting to follow the basic play framework example (YouTube video on front page of playframework.com) with IntelliJ 14.0.4 and latest version of Play (2.3.8?).

I'm not sure if this is the same problem, but when trying to perform a return redirect(routes.Application.index());, routes is not a known variable that can used.

I'm attempting to follow the basic play framework example (YouTube video on front page of playframework.com) with IntelliJ 14.0.4 and latest version of Play (2.3.8?).

@PeterRangelov

This comment has been minimized.

Show comment
Hide comment
@PeterRangelov

PeterRangelov Jun 6, 2015

Yet my application compiles and runs as expected!! Red squiggles are annoying; guys please fix dis :)

cannot resolve symbol routes

Yet my application compiles and runs as expected!! Red squiggles are annoying; guys please fix dis :)

cannot resolve symbol routes

@bpgriner

This comment has been minimized.

Show comment
Hide comment
@bpgriner

bpgriner Jun 8, 2015

+1 @PeterRangelov

I should have provided a screen shot, I'm having the exact same issue. Everything compiles and runs fine, just annoying to look at in IntelliJ.

bpgriner commented Jun 8, 2015

+1 @PeterRangelov

I should have provided a screen shot, I'm having the exact same issue. Everything compiles and runs fine, just annoying to look at in IntelliJ.

@jwsher

This comment has been minimized.

Show comment
Hide comment
@jwsher

jwsher Jun 21, 2015

FYI, This is still a problem on play 2.4. The classes compile fine but it's annoying to look at and the previously mentioned workaround of creating the fake directories doesn't work.

screen shot 2015-06-20 at 8 29 31 pm

jwsher commented Jun 21, 2015

FYI, This is still a problem on play 2.4. The classes compile fine but it's annoying to look at and the previously mentioned workaround of creating the fake directories doesn't work.

screen shot 2015-06-20 at 8 29 31 pm

@vicaba

This comment has been minimized.

Show comment
Hide comment
@vicaba

vicaba Jun 26, 2015

Yep, I have the same problem using intellij idea 14

vicaba commented Jun 26, 2015

Yep, I have the same problem using intellij idea 14

@hossamahamid

This comment has been minimized.

Show comment
Hide comment
@hossamahamid

hossamahamid Jul 5, 2015

I had the same problem with Intellij Idea 14.1.4 and play framework 2.4.2 but I managed to solve the issue with the help of the link @ghost added but it was old so I had to make little changes, here is what I did.
right click on "target" directory from the project navigator in intellij and choose "mark directory as" then "Cancel Exclusion". After that, right click on "scala-2.11/routes/main" folder and choose "mark directory as sources root". I also excluded "resolution-cache" and "streams".

I had the same problem with Intellij Idea 14.1.4 and play framework 2.4.2 but I managed to solve the issue with the help of the link @ghost added but it was old so I had to make little changes, here is what I did.
right click on "target" directory from the project navigator in intellij and choose "mark directory as" then "Cancel Exclusion". After that, right click on "scala-2.11/routes/main" folder and choose "mark directory as sources root". I also excluded "resolution-cache" and "streams".

@vicaba

This comment has been minimized.

Show comment
Hide comment
@vicaba

vicaba Jul 15, 2015

@hossamahamid I can't exclude the "./target" directory but I can exclude "project->target", nevertheless, the file "scala-2.11/routes/main" is in the "./target" directory. When you refer to "target" are you referring to the "target" directory placed at the root directory of the project?
If you can, take a look at my images and tell me if that was your situation (menu shown when I right-clicked the item highlighted in blue in the project navigator):

screen shot 2015-07-15 at 11 06 28

screen shot 2015-07-15 at 11 06 36

screen shot 2015-07-15 at 11 07 46

Maybe I can't do the expected operations because I added a related project in the build.sbt:

name := """WHTTP-front"""

version := "1.0-SNAPSHOT"

lazy val wcommon = RootProject(file("../WCommon"))

val root = (project in file(".")).enablePlugins(PlayScala).dependsOn(wcommon)

scalaVersion := "2.11.6"

//val whttp_front = Project(id = "root", base = file("."))

libraryDependencies ++= Seq(
  jdbc,
  cache,
  ws,
  specs2 % Test
)

libraryDependencies +=
  "com.typesafe.akka" %% "akka-remote" % "2.4-SNAPSHOT"

resolvers += "Akka Snapshot Repository" at "http://repo.akka.io/snapshots/"

resolvers += "scalaz-bintray" at "http://dl.bintray.com/scalaz/releases"

// Play provides two styles of routers, one expects its actions to be injected, the
// other, legacy style, accesses its actions statically.
routesGenerator := InjectedRoutesGenerator


fork in run := true

vicaba commented Jul 15, 2015

@hossamahamid I can't exclude the "./target" directory but I can exclude "project->target", nevertheless, the file "scala-2.11/routes/main" is in the "./target" directory. When you refer to "target" are you referring to the "target" directory placed at the root directory of the project?
If you can, take a look at my images and tell me if that was your situation (menu shown when I right-clicked the item highlighted in blue in the project navigator):

screen shot 2015-07-15 at 11 06 28

screen shot 2015-07-15 at 11 06 36

screen shot 2015-07-15 at 11 07 46

Maybe I can't do the expected operations because I added a related project in the build.sbt:

name := """WHTTP-front"""

version := "1.0-SNAPSHOT"

lazy val wcommon = RootProject(file("../WCommon"))

val root = (project in file(".")).enablePlugins(PlayScala).dependsOn(wcommon)

scalaVersion := "2.11.6"

//val whttp_front = Project(id = "root", base = file("."))

libraryDependencies ++= Seq(
  jdbc,
  cache,
  ws,
  specs2 % Test
)

libraryDependencies +=
  "com.typesafe.akka" %% "akka-remote" % "2.4-SNAPSHOT"

resolvers += "Akka Snapshot Repository" at "http://repo.akka.io/snapshots/"

resolvers += "scalaz-bintray" at "http://dl.bintray.com/scalaz/releases"

// Play provides two styles of routers, one expects its actions to be injected, the
// other, legacy style, accesses its actions statically.
routesGenerator := InjectedRoutesGenerator


fork in run := true

@adis-me

This comment has been minimized.

Show comment
Hide comment
@adis-me

adis-me Jul 15, 2015

Contributor

I have cancelled exlusion for the target folder in the root of my project. And now it works fine!

Contributor

adis-me commented Jul 15, 2015

I have cancelled exlusion for the target folder in the root of my project. And now it works fine!

@hossamahamid

This comment has been minimized.

Show comment
Hide comment
@hossamahamid

hossamahamid Jul 15, 2015

@vicaba yes I mean the target directory at the root. That's weird but try to exclude the target directory from the module settings window. You can open it by right click on the project directory and choosing "Open Module Settings", or by selecting "Project Structure" from "File" menu then "Modules".

@vicaba yes I mean the target directory at the root. That's weird but try to exclude the target directory from the module settings window. You can open it by right click on the project directory and choosing "Open Module Settings", or by selecting "Project Structure" from "File" menu then "Modules".

@vicaba

This comment has been minimized.

Show comment
Hide comment
@vicaba

vicaba Jul 15, 2015

@hossamahamid I've tried it and nothing changes. I've tried several combinations too, but I can't get it working.
But while I was searching for the solution I came out with two discoveries:
The first one is that if I change my default application class controller to an object, I get the correct code hints when typing the routes, but the application does not compile :S. In earlier versions of Play, the controllers where objects .
The other interesting thing I discovered is that at the moment, I can disable Play route inspections:
screen shot 2015-07-15 at 14 26 04

Change the inspections configuration by clicking on the man with a hat at the bottom right.

I'll give it another try in a few days after doing a OS clean install.

Thank you all for the support anyway.

vicaba commented Jul 15, 2015

@hossamahamid I've tried it and nothing changes. I've tried several combinations too, but I can't get it working.
But while I was searching for the solution I came out with two discoveries:
The first one is that if I change my default application class controller to an object, I get the correct code hints when typing the routes, but the application does not compile :S. In earlier versions of Play, the controllers where objects .
The other interesting thing I discovered is that at the moment, I can disable Play route inspections:
screen shot 2015-07-15 at 14 26 04

Change the inspections configuration by clicking on the man with a hat at the bottom right.

I'll give it another try in a few days after doing a OS clean install.

Thank you all for the support anyway.

@thobson

This comment has been minimized.

Show comment
Hide comment
@thobson

thobson Jul 15, 2015

@vicaba I have the same issue, I think we need to wait for Jetbrans to fix this (in the ultimate version) because I don't see how it could work without some form of "hack" from the tool vendor. As controllers are now classes the statement route..method will always be invalid because in Scala you can't call a method on a class.

thobson commented Jul 15, 2015

@vicaba I have the same issue, I think we need to wait for Jetbrans to fix this (in the ultimate version) because I don't see how it could work without some form of "hack" from the tool vendor. As controllers are now classes the statement route..method will always be invalid because in Scala you can't call a method on a class.

@vicaba

This comment has been minimized.

Show comment
Hide comment
@vicaba

vicaba Jul 15, 2015

@thobson Yep, that's just what I was thinking... We will have to wait.

vicaba commented Jul 15, 2015

@thobson Yep, that's just what I was thinking... We will have to wait.

@thobson

This comment has been minimized.

Show comment
Hide comment
@thobson

thobson Jul 15, 2015

@vicaba I just found an EAP version of the plugin which seems to work in most cases. Take a look here and download the 1.5.2.3.EAP version of the plugin. You will need to uninstall the exisiting Scala plugin then copy this new version into the plugins directory, giving it the folder name "Scala". Of course it's EAP software so it's not perfect but it does seem to work ok for me (so far!)

thobson commented Jul 15, 2015

@vicaba I just found an EAP version of the plugin which seems to work in most cases. Take a look here and download the 1.5.2.3.EAP version of the plugin. You will need to uninstall the exisiting Scala plugin then copy this new version into the plugins directory, giving it the folder name "Scala". Of course it's EAP software so it's not perfect but it does seem to work ok for me (so far!)

@vicaba

This comment has been minimized.

Show comment
Hide comment
@vicaba

vicaba Jul 17, 2015

@thobson Thanks, I'll try it as soon as I can :)

vicaba commented Jul 17, 2015

@thobson Thanks, I'll try it as soon as I can :)

@kgambrah

This comment has been minimized.

Show comment
Hide comment
@kgambrah

kgambrah Aug 7, 2015

Scala plugin 1.5.2.3.EAP version didn't work for me. I went with disabling disabiling the play routing action inspection rather.

kgambrah commented Aug 7, 2015

Scala plugin 1.5.2.3.EAP version didn't work for me. I went with disabling disabiling the play routing action inspection rather.

@pschichtel

This comment has been minimized.

Show comment
Hide comment
@pschichtel

pschichtel Aug 23, 2015

Contributor

This problem still exists in intellij 15-eap and with the scala plugin on version 1.8.

I wonder why this issue is still closed even though it is still very much a problem.

javascript-red

Contributor

pschichtel commented Aug 23, 2015

This problem still exists in intellij 15-eap and with the scala plugin on version 1.8.

I wonder why this issue is still closed even though it is still very much a problem.

javascript-red

@jroper

This comment has been minimized.

Show comment
Hide comment
@jroper

jroper Aug 24, 2015

Member

It's closed because it's a problem with the way IntelliJ imports projects, not with Play, so the issue doesn't belong in Play's issue tracker.

Member

jroper commented Aug 24, 2015

It's closed because it's a problem with the way IntelliJ imports projects, not with Play, so the issue doesn't belong in Play's issue tracker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment