diff options
author | Paul Phillips <paulp@improving.org> | 2009-04-07 17:20:15 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-04-07 17:20:15 +0000 |
commit | 150d137d20e6e6e89978be097aaf1bc1e7fc2129 (patch) | |
tree | fa76cc40f84f3da436324dc305a35c6632b838ff /src/compiler/scala/tools/nsc/InterpreterLoop.scala | |
parent | becf900b40e9201e6ab256ace7592d3d53c933ea (diff) | |
download | scala-150d137d20e6e6e89978be097aaf1bc1e7fc2129.tar.gz scala-150d137d20e6e6e89978be097aaf1bc1e7fc2129.tar.bz2 scala-150d137d20e6e6e89978be097aaf1bc1e7fc2129.zip |
Improvements to repl completion.
(it was only behind an option to be super conservative) but it can be
disabled with -Yno-completion. Now all top level identifiers can be
completed upon, so if you define
val dingdong = "abc"
def dingwhoa = 5
then d.<tab> will complete up to "ding".
Diffstat (limited to 'src/compiler/scala/tools/nsc/InterpreterLoop.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/InterpreterLoop.scala | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/InterpreterLoop.scala b/src/compiler/scala/tools/nsc/InterpreterLoop.scala index 52097e0ebf..944a978ec7 100644 --- a/src/compiler/scala/tools/nsc/InterpreterLoop.scala +++ b/src/compiler/scala/tools/nsc/InterpreterLoop.scala @@ -207,7 +207,8 @@ class InterpreterLoop(in0: Option[BufferedReader], out: PrintWriter) { */ val futLine = scala.concurrent.ops.future(readOneLine) bindSettings() - processLine(futLine()) + if (!processLine(futLine())) + return out.println("Leaving already? That hurts, it really does.") // loops until false, then returns while (processLine(readOneLine)) { } @@ -331,10 +332,10 @@ class InterpreterLoop(in0: Option[BufferedReader], out: PrintWriter) { case None => val emacsShell = System.getProperty("env.emacs", "") != "" - // tab completion off by default for now + // the interpeter is passed as an argument to expose tab completion info if (settings.Xnojline.value || emacsShell) new SimpleReader - else if (settings.completion.value) InteractiveReader.createDefault(interpreter) - else InteractiveReader.createDefault() + else if (settings.noCompletion.value) InteractiveReader.createDefault() + else InteractiveReader.createDefault(interpreter) } loadFiles(settings) |