diff options
author | Martin Odersky <odersky@gmail.com> | 2011-01-25 14:53:45 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2011-01-25 14:53:45 +0000 |
commit | be85330d5b3545ebfa12436c1030558f56d5fbd0 (patch) | |
tree | e44e91fa46aaa3dda6199a1649e7c0292534487f /src/compiler/scala/tools/nsc/interactive/Picklers.scala | |
parent | 3235722859a6ff30f186c948c78b1ee37ff36329 (diff) | |
download | scala-be85330d5b3545ebfa12436c1030558f56d5fbd0.tar.gz scala-be85330d5b3545ebfa12436c1030558f56d5fbd0.tar.bz2 scala-be85330d5b3545ebfa12436c1030558f56d5fbd0.zip |
Added methods askStructure and askLoadedTyped, ...
Added methods askStructure and askLoadedTyped, which should replace any
calls to askType. Next: remove askType.
Diffstat (limited to 'src/compiler/scala/tools/nsc/interactive/Picklers.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/interactive/Picklers.scala | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/interactive/Picklers.scala b/src/compiler/scala/tools/nsc/interactive/Picklers.scala index 1239ec5003..176e6505af 100644 --- a/src/compiler/scala/tools/nsc/interactive/Picklers.scala +++ b/src/compiler/scala/tools/nsc/interactive/Picklers.scala @@ -159,11 +159,22 @@ trait Picklers { self: Global => .wrapped { case sym ~ source => new AskLinkPosItem(sym, source, new Response) } { item => item.sym ~ item.source } .asClass (classOf[AskLinkPosItem]) + implicit def askLoadedTypedItem: CondPickler[AskLoadedTypedItem] = + pkl[SourceFile] + .wrapped { new AskLoadedTypedItem(_, new Response) } { _.source } + .asClass (classOf[AskLoadedTypedItem]) + + implicit def askStructureItem: CondPickler[AskStructureItem] = + (pkl[SourceFile] ~ pkl[Boolean]) + .wrapped { case source ~ keepLoaded => new AskStructureItem(source, keepLoaded, new Response) } { w => w.source ~ w.keepLoaded } + .asClass (classOf[AskStructureItem]) + implicit def emptyAction: CondPickler[EmptyAction] = pkl[Unit] .wrapped { _ => new EmptyAction } { _ => () } .asClass (classOf[EmptyAction]) implicit def action: Pickler[() => Unit] = - reloadItem | askTypeAtItem | askTypeItem | askLastTypeItem | askTypeCompletionItem | askScopeCompletionItem | askToDoFirstItem | emptyAction + reloadItem | askTypeAtItem | askTypeItem | askLastTypeItem | askTypeCompletionItem | askScopeCompletionItem | + askToDoFirstItem | askLinkPosItem | askLoadedTypedItem | askStructureItem | emptyAction } |