summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2009-06-12 21:20:36 +0000
committerPaul Phillips <paulp@improving.org>2009-06-12 21:20:36 +0000
commitd3ff8d400fbd813015f7eeb1a886e235f9951207 (patch)
tree45c5367685f83c1abc3a0437854529fbaa335c2b
parent8d8d1c314706143ef9e21978642df3315fb4a04b (diff)
downloadscala-d3ff8d400fbd813015f7eeb1a886e235f9951207.tar.gz
scala-d3ff8d400fbd813015f7eeb1a886e235f9951207.tar.bz2
scala-d3ff8d400fbd813015f7eeb1a886e235f9951207.zip
Loosened tab-completion requirements so one can...
Loosened tab-completion requirements so one can see inner objects like Range.BigInt.
-rw-r--r--src/compiler/scala/tools/nsc/interpreter/Completion.scala7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/interpreter/Completion.scala b/src/compiler/scala/tools/nsc/interpreter/Completion.scala
index 3e902021f1..bbda31e2e8 100644
--- a/src/compiler/scala/tools/nsc/interpreter/Completion.scala
+++ b/src/compiler/scala/tools/nsc/interpreter/Completion.scala
@@ -159,7 +159,7 @@ object Completion
private def exists(path: String) = new File(path) exists
- def isValidCompletion(x: String) = !(x contains "$") && !(excludeMethods contains x)
+ def isValidCompletion(x: String) = !(x contains "$$") && !(excludeMethods contains x)
def isClass(x: String) = x endsWith ".class"
def dropClass(x: String) = x.substring(0, x.length - 6) // drop .class
@@ -185,6 +185,7 @@ object Completion
val jars = cp.removeDuplicates filter (_ endsWith ".jar")
// for e.g. foo.bar.baz.C, returns (foo -> bar), (foo.bar -> baz), (foo.bar.baz -> C)
+ // and scala.Range$BigInt needs to go scala -> Range -> BigInt
def subpaths(s: String): List[(String, String)] = {
val segs = s.split('.')
for (i <- List.range(0, segs.length - 1)) yield {
@@ -195,7 +196,9 @@ object Completion
}
def oneJar(jar: String): Unit = {
- val classfiles = Completion.getClassFiles(jar).map(_.replace('/', '.'))
+ def cleanup(s: String): String = s map { c => if (c == '/' || c == '$') '.' else c } toString
+ val classfiles = Completion getClassFiles jar map cleanup
+
for (cl <- classfiles; (k, v) <- subpaths(cl)) {
if (map containsKey k) map.put(k, v :: map.get(k))
else map.put(k, List(v))