scala-ide / scala-worksheet

A Scala IDE plugin for a multi-line REPL (called worksheet)
96 stars 24 forks source link

Syntax error after instrumentation when using semicolon #209

Open dragos opened 9 years ago

dragos commented 9 years ago

Typing a (useless) semicolon causes invalid instrumented code:

object fooMa {
  def foo = "abc";

  foo
}

generates

object fooMa {;import org.scalaide.worksheet.runtime.library.WorksheetSupport._; def main(args: Array[String])=$execute{;$skip(49); 
  def foo = "abc";System.out.println("""foo: => String""");$skip(9); val res$0 = ;

  foo;System.out.println("""res0: String = """ + $show(res$0))}
}