summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-01-29 23:06:20 +0000
committerPaul Phillips <paulp@improving.org>2011-01-29 23:06:20 +0000
commit42eee5f32569f40e4f28992ee304fff2df4bd67b (patch)
tree01a10d2dc36f4d1d2ae94252676b99899298ede9 /src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala
parentc6e21a52fe4d362c419ae2f6bff51ca57f4a7c90 (diff)
downloadscala-42eee5f32569f40e4f28992ee304fff2df4bd67b.tar.gz
scala-42eee5f32569f40e4f28992ee304fff2df4bd67b.tar.bz2
scala-42eee5f32569f40e4f28992ee304fff2df4bd67b.zip
Cut off the hunt for completions once something...
Cut off the hunt for completions once something raises its hand so we don't end up with java.lang.Double members in scala.Double. Closes #3955, no review.
Diffstat (limited to 'src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala')
-rw-r--r--src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala b/src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala
index 148b80df12..1e84c6a829 100644
--- a/src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala
+++ b/src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala
@@ -234,7 +234,15 @@ class JLineCompletion(val intp: IMain) extends Completion with CompletionOutput
def topLevel = topLevelBase ++ imported
// the first tier of top level objects (doesn't include file completion)
- def topLevelFor(parsed: Parsed) = topLevel flatMap (_ completionsFor parsed)
+ def topLevelFor(parsed: Parsed): List[String] = {
+ topLevel foreach { ca =>
+ ca completionsFor parsed match {
+ case Nil => ()
+ case xs => return xs
+ }
+ }
+ Nil
+ }
// the most recent result
def lastResult = Forwarder(() => ids follow intp.mostRecentVar)