Skip to content
Browse files

Update REPL code to use our own version of JLineReader, which fixes #89.

I'm not entirely sure why this broke in the jump from Scala 2.9.0.1 to
2.9.1 -- maybe something about name resolution changed?
  • Loading branch information...
1 parent 3fad5e5 commit 63da22c025e85e9652bdc22de8d63f9af9d38cae @mateiz mateiz committed Nov 7, 2011
View
8 repl/src/main/scala/spark/repl/SparkILoop.scala
@@ -802,13 +802,13 @@ class SparkILoop(in0: Option[BufferedReader], val out: PrintWriter, val master:
def chooseReader(settings: Settings): InteractiveReader = {
if (settings.Xnojline.value || Properties.isEmacsShell)
SimpleReader()
- else try JLineReader(
+ else try SparkJLineReader(
if (settings.noCompletion.value) NoCompletion
- else new JLineCompletion(intp)
+ else new SparkJLineCompletion(intp)
)
catch {
case ex @ (_: Exception | _: NoClassDefFoundError) =>
- echo("Failed to created JLineReader: " + ex + "\nFalling back to SimpleReader.")
+ echo("Failed to created SparkJLineReader: " + ex + "\nFalling back to SimpleReader.")
SimpleReader()
}
}
@@ -985,7 +985,7 @@ object SparkILoop {
repl.settings = new Settings(echo)
repl.settings.embeddedDefaults[T]
repl.createInterpreter()
- repl.in = JLineReader(repl)
+ repl.in = SparkJLineReader(repl)
// rebind exit so people don't accidentally call sys.exit by way of predef
repl.quietRun("""def exit = println("Type :quit to resume program execution.")""")
View
2 repl/src/main/scala/spark/repl/SparkJLineCompletion.scala
@@ -15,7 +15,7 @@ import collection.mutable.ListBuffer
// REPL completor - queries supplied interpreter for valid
// completions based on current contents of buffer.
-class JLineCompletion(val intp: SparkIMain) extends Completion with CompletionOutput {
+class SparkJLineCompletion(val intp: SparkIMain) extends Completion with CompletionOutput {
val global: intp.global.type = intp.global
import global._
import definitions.{ PredefModule, RootClass, AnyClass, AnyRefClass, ScalaPackage, JavaLangPackage }
View
6 repl/src/main/scala/spark/repl/SparkJLineReader.scala
@@ -73,7 +73,7 @@ class SparkJLineReader(val completion: Completion) extends InteractiveReader {
def readOneKey(prompt: String) = consoleReader readOneKey prompt
}
-object JLineReader {
- def apply(intp: SparkIMain): JLineReader = apply(new JLineCompletion(intp))
- def apply(comp: Completion): JLineReader = new JLineReader(comp)
+object SparkJLineReader {
+ def apply(intp: SparkIMain): SparkJLineReader = apply(new SparkJLineCompletion(intp))
+ def apply(comp: Completion): SparkJLineReader = new SparkJLineReader(comp)
}

0 comments on commit 63da22c

Please sign in to comment.
Something went wrong with that request. Please try again.