Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Worksheet deletes code on save - Can you name a worksheet "queries"? #108

Open
GlenKPeterson opened this Issue Oct 31, 2012 · 2 comments

Comments

Projects
None yet
3 participants

When I save the following worksheet (queries.sc):

object queries {
  case class Book(title: String, authors: List[String])
}

it deletes my code and replaces it with:

object queries {
  println("Welcome to the Scala worksheet")       //> Welcome to the Scala worksheet\
}

This is particularly annoying when I have typed a half-page of code afterwards and it all disappears on save (Ctrl-S), often with no way to undo. Having the above case class statement at the top of the file like this seems to trigger it.

Eclipse 3.7.2, Scala IDE 2.1-M2-20121018-1623-Typesafe, on 64-bit Ubuntu Linux 12.04

UPDATE: The moral of this story may be not to name a worksheet "queries." I did the same thing in a worksheet with a different name and had no issue.

Owner

dotta commented Oct 31, 2012

Admittedly, the worksheet runtime goes nuts when naming a worksheet queries. I actually didn't managed to exactly reproduce the issue as reported, but I did notice there was an entry in the Eclipse Error Log (so I've opened another ticket #109).

That said, I think what you are experiencing is more than just a crash in the runtime. If I have to guess, it looks like a race-condition between the editor and the evaluator. I'll have to investigate.

Thanks a ton for reporting this!

I've just experienced the same issue. I'm following the Coursera course on Functional Programming in Scala. In lecture 6, I created a worksheet called 'session' as per the lecture, and typed in most of the code for the examples in that lecture and on one of my saves all the code was deleted, and I was left with the boilerplate worksheet code as above:

object session {
  println("Welcome to the Scala worksheet")       //> Welcome to the Scala worksheet
}

Eclipse details
Version: Indigo Service Release 2
Build id: 20120216-1857

Scala Plugin version: 3.0.0.v-2_10-2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment