I am newbie in scala and SBT
I started using IDEA with SBT and faced unclear error (Expression type DslEntry must conform to Def.SettingsDefinition in SBT file)
It's very simple empty test project with jetty plugin (example taken from plugin site)
here's plugins.sbt source:
logLevel := Level.Warn
addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "2.1.0")
This error is present only in IDEA GUI. If I compile project - all fine. from console - all fine. But I do not like when something does not work properly
I tried to download last version of SBT and set path to it in global IDEA properties - the problem persists.
I downloaded last intellij IDEA EAP with last version of scala plugin, sbt plugin and another plugins - the problem persists.
Can anyone help to solve this issue?
Thanks
Click sbt on the right sidebar to open the tool window. The tool window displays the sbt linked projects, their tasks, dependencies, and all changes made to the underlying build.
IntelliJ plugin can be found here http://confluence.jetbrains.com/display/SCA/Scala+Plugin+for+IntelliJ+IDEA or can be installed directoly from within the IDE using Settings -> Plugins dialog. Afterwards one can just do File -> New Project -> Scala -> SBT based.
Try this:
lazy val root = (project in file(".")).
enablePlugins(JettyPlugin).
settings(
name := "test",
scalaVersion := "2.11.7",
version := "1.0"
)
Updates: The followings are what I know:
The error comes from intellij's sbt plugin https://github.com/JetBrains/intellij-sbt/blob/master/idea-plugin/src/main/scala/org/jetbrains/sbt/language/SbtAnnotator.scala#L41.
The return type of (project in file(".")).
enablePlugins(JettyPlugin)
is Project
. It is acceptable by sbt plugin.
However, if you use standalone enablePlugins(JettyPlugin)
, the return type is different, and it becomes DslEntry
which makes the sbt plugin unhappy. Another way to workaround with that is simply to consume the return type of enablePlugins
. For example:
val foo = enablePlugins(JettyPlugin)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With