diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2015-09-09 21:45:04 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2015-09-10 11:46:36 +1000 |
commit | b89874b7c0bb9ad8e2276b652580f3aaf3e5c621 (patch) | |
tree | f3b1705209df7d0322b622ba740a6533de48d54c /test | |
parent | 46211ddd07432f06d125d9926cd8b42bc7bfba40 (diff) | |
download | scala-b89874b7c0bb9ad8e2276b652580f3aaf3e5c621.tar.gz scala-b89874b7c0bb9ad8e2276b652580f3aaf3e5c621.tar.bz2 scala-b89874b7c0bb9ad8e2276b652580f3aaf3e5c621.zip |
Fix REPL completion of symbolic identifiers
Recover part of the identifier that preceded the cursor from the
source, rather than from the name in the `Select` node, which might
contains an encoded name that differs in length from the one in
source.
Diffstat (limited to 'test')
-rw-r--r-- | test/junit/scala/tools/nsc/interpreter/CompletionTest.scala | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/junit/scala/tools/nsc/interpreter/CompletionTest.scala b/test/junit/scala/tools/nsc/interpreter/CompletionTest.scala index 177d4922fb..514f30571e 100644 --- a/test/junit/scala/tools/nsc/interpreter/CompletionTest.scala +++ b/test/junit/scala/tools/nsc/interpreter/CompletionTest.scala @@ -48,7 +48,14 @@ class CompletionTest { checkExact(completer, """class C { asInstanceO""")("asInstanceOf") // Output is sorted - assertEquals(List("prefix_aaa", "prefix_nnn", "prefix_zzz"), completer.complete("""class C { def prefix_nnn = 0; def prefix_zzz = 0; def prefix_aaa = 0; prefix_""").candidates) + assertEquals(List("prefix_aaa", "prefix_nnn", "prefix_zzz"), completer.complete( """class C { def prefix_nnn = 0; def prefix_zzz = 0; def prefix_aaa = 0; prefix_""").candidates) + } + + @Test + def symbolically(): Unit = { + val intp = newIMain() + val completer = new PresentationCompilerCompleter(intp) + checkExact(completer, """class C { def +++(a: Any) = 0; def ---(a: Any) = 0; this.++""")("+++") } @Test |