XML highlighting broken with some embedded statements
Hi,
The following valid Scala code is considered broken by the plugin:
import scala.collection.mutable.ListBuffer
object BrokenXml extends Application {
val xml = <xml>{
val nodes = new ListBuffer[Node]
nodes + <element/>
nodes
}</xml>
println(xml)
}
It results in the following highlighting errors:
Hovering over the errors displays: "Scala expression expected in injection in xml"
Cheers,
Andrew
Please sign in to leave a comment.
It has done according scala language spec:
ScalaExpr ::= ‘{’ Expr ‘}’
So if you want for now to hide red code you can wrap it into additional braces (block expression):
But of course it's not rigth thing for us, I'll ask about it and fix accodrding compiler (not spec).
Best regards,
Alexander Podkhalyuzin.
Thanks for the quick response ... and you have my sympathies for mismatches between the spec and compiler.
Cheers,
Andrew
Ok, specification was fixed and I added appropriate change. From next release you can use Block(not only Expr) inside Scala injections in xml.