diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2015-09-09 19:38:29 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2015-09-10 11:43:33 +1000 |
commit | 46211ddd07432f06d125d9926cd8b42bc7bfba40 (patch) | |
tree | 7d88848c175da100d0e70c4ed682c2ef354c8822 /test/junit | |
parent | 0dbdaf8b1fb64806d35c18b362184293d46c89cb (diff) | |
download | scala-46211ddd07432f06d125d9926cd8b42bc7bfba40.tar.gz scala-46211ddd07432f06d125d9926cd8b42bc7bfba40.tar.bz2 scala-46211ddd07432f06d125d9926cd8b42bc7bfba40.zip |
Fix completion for synthetic case modules and methods
I'm pretty sure the `isSynthetic` call added in 854de25ee6 should
instead be `isArtifact`, so that's what I've implemented here.
`isSynthetic` used to also filter out error symbols, which are
created with the flags `SYNTHETIC | IS_ERROR`. I've added an addition
test for `isError`, which was needed to keep the output of
`presentation/scope-completion-import` unchanged.
The checkfile for `presentation/callcc-interpreter` is modified to
add the additional completion proposals: synthetic companion objects.
Diffstat (limited to 'test/junit')
-rw-r--r-- | test/junit/scala/tools/nsc/interpreter/CompletionTest.scala | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/test/junit/scala/tools/nsc/interpreter/CompletionTest.scala b/test/junit/scala/tools/nsc/interpreter/CompletionTest.scala index 5b35c37c7f..177d4922fb 100644 --- a/test/junit/scala/tools/nsc/interpreter/CompletionTest.scala +++ b/test/junit/scala/tools/nsc/interpreter/CompletionTest.scala @@ -81,6 +81,12 @@ class CompletionTest { checkExact(completer, "new C().x_y")("x_y_z") checkExact(completer, "(1 : O.T).toCha")("toChar") + + intp.interpret("case class X_y_z()") + val completer1 = new PresentationCompilerCompleter(intp) + checkExact(completer1, "new X_y_")("X_y_z") + checkExact(completer1, "X_y_")("X_y_z") + checkExact(completer1, "X_y_z.app")("apply") } @Test @@ -137,8 +143,8 @@ class CompletionTest { def firstCompletionWithNoPrefixHidesUniversalMethodsAndExtensionMethods(): Unit = { val intp = newIMain() val completer = new PresentationCompilerCompleter(intp) - checkExact(completer, "case class C(a: Int, b: Int) { this.")("a", "b") - assert(Set("asInstanceOf", "==").diff(completer.complete("case class C(a: Int, b: Int) { this.").candidates.toSet).isEmpty) + checkExact(completer, "class C(val a: Int, val b: Int) { this.")("a", "b") + assert(Set("asInstanceOf", "==").diff(completer.complete("class C(val a: Int, val b: Int) { this.").candidates.toSet).isEmpty) checkExact(completer, "case class D(a: Int, b: Int) { this.a")("a", "asInstanceOf") } |