You can clone with
HTTPS or Subversion.
This should probably be optional, but it would be nice to configure scalac options in Eclipse from scalacOptions in SBT.
Upvote this one. It's really tiresome to configure Eclipse again once sbt has been configured.
This one mandates an Eclipse expert. I have been one, but that was in another age. So please feel free to jump in: Fork, change, test and send a pull request. Looking forward to your contributions!
I don't think Eclipse expert is needed here. All those settings are stored in simple property file. See:
$ cat .settings/org.scala-ide.sdt.core.prefs
#Wed Sep 21 12:29:20 CEST 2011
All it takes is to map Sbt settings to values in this property file. I don't have any free cycles left to spend on it, though.
Thanks for your hint.
Nevertheless it does not look that trivial. In a test project I enabled "Use Project Settings" for the Scala Compiler and I got a whole lot more, e.g. settings for coloring, formatting, although I did not touch the check boxes for these. Looks like a can of worms ...
I opened #53 because that limited subset is clearly not a can of worms.
I believe that there's no can of worms here. Just generate org.scala-ide.sdt.core.prefs and ignore the rest. If you don't generate other files Eclipse should fallback on defaults.
@skyluc or @dragos should give us confirmation that it's safe thing to do.
AFAIK it's correct. Here's a sample of that file:
The important thing is to add 'scala.compiler.useProjectSettings=true' so that Eclipse does not use the default, per-workspace, settings.
And the file name is org.scala-ide.sdt.core.prefs?
yes, and it lives inside your project, under .settings/.
Now the can of worms is opening ...
sbt gives me scalacOptions like this:
First, I have to get rid of the leading "-". No problem.
But how should I know what value to use? E.g.
What does SBT give you? The compiler Setting object, or its own class that wraps a setting? If it's the compiler setting, you can use 'value' to retrieve the current value for that setting.
From sbt I get scalacOptions which is just a Seq[String], e.g. Seq("-unchecked", "-deperecation"). It looks like in Eclipse I need to provide values, e.g. unchecked=false etc.
It's a bit more complicated, because there are options that aren't boolean, such as phase names or strings (say -g:vars, -P:continuation:enable, etc). A more general scheme would be:
All types of settings are 'documented' here: https://github.com/scala/scala/blob/master/src/compiler/scala/tools/nsc/settings/AbsScalaSettings.scala
Looks like I have found the proper regex: """-?([^:]):?(.)"""
Will publish a snapshot today. Please test then.
closes #40: Use scalacOptions to configure ch.epfl.lamp.sdt.core.prefs
Yo da man
Wanted build this locally and try it out but run into #60.