When using the Spray API, I often encounter compiler errors reported by Scala IDE which compile correctly in SBT. For example, in Spray there is an Unmarshaller type and also a Unmarshaller object. This seems to have something to do with the problem. For this code:
The IDE says "value delegate is not a member of object spray.httpx.unmarshalling.Unmarshaller". I have attached an SBT project and also a screenshot of the IDE showing the error. Here are the installation details from the IDE plugin:
Scala IDE version:
4.0.0.rc1-2_11-201410211318-7115fbd
Scala compiler version:
2.11.2.
Scala library version:
2.11.2.
Eclipse version:
4.3.2.v20140221-1700
Class loader store: 2 entries
Compiler v. 2.11.2.(/Applications/Eclipse/plugins/org.scala-lang.scala-compiler_2.11.2.v20140721-095018-73fb460c1c.jar)
Compiler v. 2.10.4.(/Applications/Eclipse/plugins/org.scala-ide.scala210.jars_4.0.0.201410211316/target/jars/scala-compiler.jar)
The project is set to use Scala 2.10.4.
import spray.http._
import spray.httpx.marshalling._
import spray.httpx.unmarshalling._
object Unmarshallers {
val `application/special-custom-thing` = MediaTypes.register(MediaType.custom("application/special-custom-thing"))
case class SpecialCustomThing(value: String)
val SPARQLQueryBodyUnmarshaller = Unmarshaller.delegate[String, SpecialCustomThing](`application/special-custom-thing`)(SpecialCustomThing)
}
The IDE says "value delegate is not a member of object spray.httpx.unmarshalling.Unmarshaller". I have attached an SBT project and also a screenshot of the IDE showing the error. Here are the installation details from the IDE plugin:
Scala IDE version:
4.0.0.rc1-2_11-201410211318-7115fbd
Scala compiler version:
2.11.2.
Scala library version:
2.11.2.
Eclipse version:
4.3.2.v20140221-1700
Class loader store: 2 entries
Compiler v. 2.11.2.(/Applications/Eclipse/plugins/org.scala-lang.scala-compiler_2.11.2.v20140721-095018-73fb460c1c.jar)
Compiler v. 2.10.4.(/Applications/Eclipse/plugins/org.scala-ide.scala210.jars_4.0.0.201410211316/target/jars/scala-compiler.jar)
The project is set to use Scala 2.10.4.
Leave a comment
I reproduced the problem also on Scala 2.11.4, and Scala IDE 4.0.0-rc1.
To reproduce:
- unpack the project
- run
- import the project in Scala IDE
- open org/nescent/spray/Unmarshallers.scala
The problem disappears if the source is added to the spray jars. It can be done using
It looks like the presentation provider doesn't correctly type the reference to
To reproduce:
- unpack the project
- run
sbt eclipse
- import the project in Scala IDE
- open org/nescent/spray/Unmarshallers.scala
The problem disappears if the source is added to the spray jars. It can be done using
sbt 'eclipse with-source=true'
.It looks like the presentation provider doesn't correctly type the reference to
Unmarshaller
. When triggering hyperlinking, 2 classes are proposed, the one from spray.httpx.unmarshalling and the one from javax.xml.bind.
on 2014-11-17 01:57 *
By Iulian Dragos
@jason.zaugg, do you think this could be a problem with the unpickler?
No file chosen
You have an empty file field. Please select or remove it.
Name | Size | ||
---|---|---|---|
scala-ide-spray.tgz | 1015 Bytes | Added by jbalhoff on 2014-10-28 - Upload new version | |
spray_error.png | 64.3 KB | Added by jbalhoff on 2014-10-28 - Upload new version | |
scala-ide-spray-211.tar.gz | 20 KB | Added by skyluc on 2014-11-12 - Upload new version |