Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignoring TwirlKeys.templateImports in build.sbt #283

Closed
amirkarimi opened this issue May 26, 2015 · 3 comments
Closed

Ignoring TwirlKeys.templateImports in build.sbt #283

amirkarimi opened this issue May 26, 2015 · 3 comments

Comments

@amirkarimi
Copy link

I used TwirlKeys.templateImports in build.sbt like this:

TwirlKeys.templateImports ++= Seq(
  "reactivemongo.bson.{BSONObjectID, BSONDocument}",
  "models.contents._",
  "api.contents._",
  "reactivemongo.api.gridfs.ReadFile")

But Scala IDE ignores them and reports not found errors in play template files. The errors will be fixed by adding those imports in project settings manually (Project Properties -> Play2 -> New...).

Eclipse: 4.1.0-vfinal-20150525-1102-Typesafe
Scala IDE for Eclipse: 4.1.0.v-2_11-201505250839
Scala 2.11.6: 4.1.0.201505250838
Play2 support in Scala IDE: 0.4.6.v-2_11-201505250858

@benmccann
Copy link
Contributor

What version of sbteclipse? Are you sure this is a bug in sbteclipse?

@amirkarimi
Copy link
Author

sbteclipse version is 3.0.0. Actually I posted this issue for scala-ide-play2 project but no body replied.

I think it would be another solution to add template imports in project settings file at .settings/org.scala-ide.play2.prefs like this:

eclipse.preferences.version=1
templateImports=import reactivemongo.bson.{BSONObjectID, BSONDocument}\nimport models.contents._\nimport api.contents._\nimport reactivemongo.api.gridfs.ReadFile\n

I'm not sure if it's possible to be supported by Scala IDE but this is another solution which I think is possible. However we need to run sbteclipse after changing build.sbt.

@benmccann
Copy link
Contributor

I'd suggest upgrading to Play 2.4 and sbteclipse 4.0.0. There were some problems in earlier versions.

That being said, there's no information here that leads me to believe there's any bug in sbteclipse

I don't mean to be unhelpful by closing this, but this really seems like a problem in ScalaIDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants