summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/interactive/REPL.scala
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2010-12-16 15:24:41 +0000
committerIulian Dragos <jaguarul@gmail.com>2010-12-16 15:24:41 +0000
commit4850e825a752e8f88223bebe0a5b998f9e22eb3b (patch)
treeb841c66d09fdfd73813fa3ac2622385b47e7f644 /src/compiler/scala/tools/nsc/interactive/REPL.scala
parente2edb26440c01dcef033732b6ac065b2a0928033 (diff)
downloadscala-4850e825a752e8f88223bebe0a5b998f9e22eb3b.tar.gz
scala-4850e825a752e8f88223bebe0a5b998f9e22eb3b.tar.bz2
scala-4850e825a752e8f88223bebe0a5b998f9e22eb3b.zip
Added more logging to the presentation compiler.
Diffstat (limited to 'src/compiler/scala/tools/nsc/interactive/REPL.scala')
-rw-r--r--src/compiler/scala/tools/nsc/interactive/REPL.scala14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/interactive/REPL.scala b/src/compiler/scala/tools/nsc/interactive/REPL.scala
index 4225460d1c..9572f25a69 100644
--- a/src/compiler/scala/tools/nsc/interactive/REPL.scala
+++ b/src/compiler/scala/tools/nsc/interactive/REPL.scala
@@ -83,6 +83,8 @@ object REPL {
val reloadResult = new Response[Unit]
val typeatResult = new Response[comp.Tree]
val completeResult = new Response[List[comp.Member]]
+ val typedResult = new Response[comp.Tree]
+
def makePos(file: String, off1: String, off2: String) = {
val source = toSourceFile(file)
comp.rangePos(source, off1.toInt, off1.toInt, off2.toInt)
@@ -95,11 +97,23 @@ object REPL {
comp.askTypeCompletion(pos, completeResult)
show(completeResult)
}
+ def doTypedTree(file: String) {
+ comp.askType(toSourceFile(file), true, typedResult)
+ show(typedResult)
+ }
+
loop { line =>
(line split " ").toList match {
case "reload" :: args =>
comp.askReload(args map toSourceFile, reloadResult)
show(reloadResult)
+ case "reloadAndAskType" :: file :: millis :: Nil =>
+ comp.askReload(List(toSourceFile(file)), reloadResult)
+ Thread.sleep(millis.toInt)
+ comp.askType(toSourceFile(file), false, typedResult)
+ show(typedResult)
+ case List("typed", file) =>
+ doTypedTree(file)
case List("typeat", file, off1, off2) =>
doTypeAt(makePos(file, off1, off2))
case List("typeat", file, off1) =>