diff options
author | Paul Phillips <paulp@improving.org> | 2011-08-25 17:33:37 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-08-25 17:33:37 +0000 |
commit | fbb5b57d65d9c786ef618c92165ca1e3a72863ce (patch) | |
tree | e655741fdf826293613e9ff334fdcddeb5174ac3 /src/compiler/scala/tools/nsc/interpreter/ReplReporter.scala | |
parent | 006cd779797b2ddd0af8a5fe5ad87671509f106f (diff) | |
download | scala-fbb5b57d65d9c786ef618c92165ca1e3a72863ce.tar.gz scala-fbb5b57d65d9c786ef618c92165ca1e3a72863ce.tar.bz2 scala-fbb5b57d65d9c786ef618c92165ca1e3a72863ce.zip |
Made -Xprompt more useful, less crashy and more...
Made -Xprompt more useful, less crashy and more open to showing you the
stack trace without aborting. For example, the following would resume
compilation after showing the trace.
% scala -deprecation -Xprompt -nc -e 'case class Foo' foo.scala:1:
warning: case classes without a parameter list have been deprecated;
use either case objects or case classes with `()' as parameter list.
case class Foo ^
a)bort, s)tack, r)esume: s
java.lang.Exception
[...]
at scala.tools.nsc.ast.parser.Parsers$UnitParser.deprecationWarning(Parsers.scala:207)
at scala.tools.nsc.ast.parser.Parsers$Parser.paramClauses(Parsers.scala:2058)
at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$classDef$1.apply(Parsers.scala:2557)
at scala.tools.nsc.ast.parser.Parsers$Parser$$anonfun$classDef$1.apply(Parsers.scala:2545)
No review.
Diffstat (limited to 'src/compiler/scala/tools/nsc/interpreter/ReplReporter.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/interpreter/ReplReporter.scala | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/interpreter/ReplReporter.scala b/src/compiler/scala/tools/nsc/interpreter/ReplReporter.scala index e181f98018..dac20ad348 100644 --- a/src/compiler/scala/tools/nsc/interpreter/ReplReporter.scala +++ b/src/compiler/scala/tools/nsc/interpreter/ReplReporter.scala @@ -9,7 +9,7 @@ package interpreter import reporters._ import IMain._ -class ReplReporter(intp: IMain) extends ConsoleReporter(intp.settings, null, new ReplStrippingWriter(intp)) { +class ReplReporter(intp: IMain) extends ConsoleReporter(intp.settings, Console.in, new ReplStrippingWriter(intp)) { override def printMessage(msg: String) { // Avoiding deadlock if the compiler starts logging before // the lazy val is complete. @@ -19,4 +19,9 @@ class ReplReporter(intp: IMain) extends ConsoleReporter(intp.settings, null, new } else Console.println("[init] " + msg) } + + override def displayPrompt() { + if (intp.totalSilence) () + else super.displayPrompt() + } } |