diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2015-09-24 13:22:29 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2015-09-24 14:33:19 +1000 |
commit | 2c9e506bc32248f9ae4929790a0cb7484a53a66e (patch) | |
tree | 67ed4da07b4ad128803bf4bfa5b253fad0417b42 /src/repl/scala/tools/nsc/interpreter/PresentationCompilerCompleter.scala | |
parent | a6c1687aa762bc8317fe4995ec1b26bed64865e8 (diff) | |
download | scala-2c9e506bc32248f9ae4929790a0cb7484a53a66e.tar.gz scala-2c9e506bc32248f9ae4929790a0cb7484a53a66e.tar.bz2 scala-2c9e506bc32248f9ae4929790a0cb7484a53a66e.zip |
Support completion in erroneous string interpolation.
In the code:
```
s"${fooo<CURSOR"
```
The parser treats `fooo` as a interpolator ID for the quote that
we actually intend to end the interpolated string.
Inserting a space (in addition to `__CURSOR__` that we already
patch in to avoid parsing a partial identifier as a keyword),
solves this problem.
Diffstat (limited to 'src/repl/scala/tools/nsc/interpreter/PresentationCompilerCompleter.scala')
-rw-r--r-- | src/repl/scala/tools/nsc/interpreter/PresentationCompilerCompleter.scala | 2 |
1 files changed, 1 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 |