diff options
-rw-r--r-- | src/repl/scala/tools/nsc/interpreter/PresentationCompilerCompleter.scala | 2 | ||||
-rw-r--r-- | test/junit/scala/tools/nsc/interpreter/CompletionTest.scala | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/repl/scala/tools/nsc/interpreter/PresentationCompilerCompleter.scala b/src/repl/scala/tools/nsc/interpreter/PresentationCompilerCompleter.scala index 0fb3236966..4b0330aaf7 100644 --- a/src/repl/scala/tools/nsc/interpreter/PresentationCompilerCompleter.scala +++ b/src/repl/scala/tools/nsc/interpreter/PresentationCompilerCompleter.scala @@ -36,7 +36,7 @@ class PresentationCompilerCompleter(intp: IMain) extends Completion with ScalaCo // secret handshakes val slashPrint = """.*// *print *""".r val slashTypeAt = """.*// *typeAt *(\d+) *(\d+) *""".r - val Cursor = IMain.DummyCursorFragment + val Cursor = IMain.DummyCursorFragment + " " def print(result: Result) = { val offset = result.preambleLength diff --git a/test/junit/scala/tools/nsc/interpreter/CompletionTest.scala b/test/junit/scala/tools/nsc/interpreter/CompletionTest.scala index 514f30571e..d00a9bf69a 100644 --- a/test/junit/scala/tools/nsc/interpreter/CompletionTest.scala +++ b/test/junit/scala/tools/nsc/interpreter/CompletionTest.scala @@ -52,6 +52,14 @@ class CompletionTest { } @Test + def incompleteStringInterpolation(): Unit = { + val intp = newIMain() + val completer = new PresentationCompilerCompleter(intp) + checkExact(completer, """val x_y_z = 1; s"${x_""", "}\"")("x_y_z") + checkExact(completer, """val x_y_z = 1; s"${x_""", "\"")("x_y_z") + } + + @Test def symbolically(): Unit = { val intp = newIMain() val completer = new PresentationCompilerCompleter(intp) |