From 378c66cd21bb0bc098e5a121d60a1fef3bb8957d Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Fri, 29 May 2020 23:01:12 +0200 Subject: [PATCH 1/3] Upgrade sbt to 1.3.12 --- project/build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/build.properties b/project/build.properties index a919a9b5f46b..654fe70c42c7 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.3.8 +sbt.version=1.3.12 From ff7673c1aed82cdc7293ddd71f43d2176160eb9a Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Mon, 1 Jun 2020 22:10:16 +0200 Subject: [PATCH 2/3] Upgrade JLine to 3.15.0 Align ourselves with scalac: https://github.com/scala/scala/pull/9024 --- compiler/src/dotty/tools/repl/JLineTerminal.scala | 2 ++ project/Build.scala | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/compiler/src/dotty/tools/repl/JLineTerminal.scala b/compiler/src/dotty/tools/repl/JLineTerminal.scala index 3376714e5bee..abb362a2e84c 100644 --- a/compiler/src/dotty/tools/repl/JLineTerminal.scala +++ b/compiler/src/dotty/tools/repl/JLineTerminal.scala @@ -76,6 +76,8 @@ final class JLineTerminal extends java.io.Closeable { val highlighted = SyntaxHighlighting.highlight(buffer) AttributedString.fromAnsi(highlighted) } + def setErrorPattern(errorPattern: java.util.regex.Pattern): Unit = {} + def setErrorIndex(errorIndex: Int): Unit = {} } /** Provide multi-line editing support */ diff --git a/project/Build.scala b/project/Build.scala index e3f75a733f7a..a0a7a7046ac7 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -493,9 +493,9 @@ object Build { libraryDependencies ++= Seq( "org.scala-lang.modules" % "scala-asm" % "7.3.1-scala-1", // used by the backend Dependencies.`compiler-interface`, - "org.jline" % "jline-reader" % "3.9.0", // used by the REPL - "org.jline" % "jline-terminal" % "3.9.0", - "org.jline" % "jline-terminal-jna" % "3.9.0" // needed for Windows + "org.jline" % "jline-reader" % "3.15.0", // used by the REPL + "org.jline" % "jline-terminal" % "3.15.0", + "org.jline" % "jline-terminal-jna" % "3.15.0" // needed for Windows ), // For convenience, change the baseDirectory when running the compiler From e5ccd703c91debf731bc308742ca7d9fcd528125 Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Mon, 1 Jun 2020 22:58:31 +0200 Subject: [PATCH 3/3] Finer grained word boundaries for the REPL's line editor Adapted from https://github.com/scala/scala/pull/9017, this lets you edit: ``` scala> this.toString ``` To: ``` scala> this. ``` Co-Authored-By: Jason Zaugg --- compiler/src/dotty/tools/repl/JLineTerminal.scala | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/src/dotty/tools/repl/JLineTerminal.scala b/compiler/src/dotty/tools/repl/JLineTerminal.scala index abb362a2e84c..70f5950b4b4f 100644 --- a/compiler/src/dotty/tools/repl/JLineTerminal.scala +++ b/compiler/src/dotty/tools/repl/JLineTerminal.scala @@ -9,6 +9,7 @@ import dotty.tools.dotc.util.SourceFile import org.jline.reader import org.jline.reader.Parser.ParseContext import org.jline.reader._ +import org.jline.reader.impl.LineReaderImpl import org.jline.reader.impl.history.DefaultHistory import org.jline.terminal.TerminalBuilder import org.jline.utils.AttributedString @@ -60,6 +61,8 @@ final class JLineTerminal extends java.io.Closeable { // this is supplied from the EOFError.getMissing() method .variable(LIST_MAX, 400) // Ask user when number of completions exceed this limit (default is 100). .variable(BLINK_MATCHING_PAREN, 0L) // Don't blink the opening paren after typing a closing paren. + .variable(WORDCHARS, + LineReaderImpl.DEFAULT_WORDCHARS.filterNot("*?.[]~=/&;!#%^(){}<>".toSet)) // Finer grained word boundaries .option(INSERT_TAB, true) // At the beginning of the line, insert tab instead of completing. .option(AUTO_FRESH_LINE, true) // if not at start of line before prompt, move to new line. .option(DISABLE_EVENT_EXPANSION, true) // don't process escape sequences in input