summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/interpreter/ReplReporter.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-05-31 05:08:25 +0000
committerPaul Phillips <paulp@improving.org>2011-05-31 05:08:25 +0000
commitedad717cc1934d80dc0b6a9af528eed8ef4b30b6 (patch)
treeabd8506f32326d513177569192c0ae5d546cae8a /src/compiler/scala/tools/nsc/interpreter/ReplReporter.scala
parent35f7c2bde563b501e9661aace1e1610990b51544 (diff)
downloadscala-edad717cc1934d80dc0b6a9af528eed8ef4b30b6.tar.gz
scala-edad717cc1934d80dc0b6a9af528eed8ef4b30b6.tar.bz2
scala-edad717cc1934d80dc0b6a9af528eed8ef4b30b6.zip
Working on the finer points of the Total Repl E...
Working on the finer points of the Total Repl Experience. Some of what is in this patch: -- Instantaneous repl startup. Closes #4561. -- SIGINT handler installed last. If you've been annoyed at the repl being difficult to interrupt during its initialization, this one is especially for you. -- Started abstracting out some bits which would go into an API and reconfiguring the repl in those terms. For a good time, call S-C-A-L-A -Dscala.repl.power. No review.
Diffstat (limited to 'src/compiler/scala/tools/nsc/interpreter/ReplReporter.scala')
-rw-r--r--src/compiler/scala/tools/nsc/interpreter/ReplReporter.scala22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/interpreter/ReplReporter.scala b/src/compiler/scala/tools/nsc/interpreter/ReplReporter.scala
new file mode 100644
index 0000000000..ab0911d374
--- /dev/null
+++ b/src/compiler/scala/tools/nsc/interpreter/ReplReporter.scala
@@ -0,0 +1,22 @@
+/* NSC -- new Scala compiler
+ * Copyright 2002-2011 LAMP/EPFL
+ * @author Paul Phillips
+ */
+
+package scala.tools.nsc
+package interpreter
+
+import reporters._
+import IMain._
+
+class ReplReporter(intp: IMain) extends ConsoleReporter(intp.settings, null, new ReplStrippingWriter(intp)) {
+ override def printMessage(msg: String) {
+ // Avoiding deadlock if the compiler starts logging before
+ // the lazy val is complete.
+ if (intp.isInitializeComplete) {
+ if (intp.totalSilence) ()
+ else super.printMessage(msg)
+ }
+ else Console.println(msg)
+ }
+}