Add method overload to keep binary compatibility

This commit is contained in:
Iulian Dragos 2023-08-08 09:54:09 +02:00
parent 82ae293e3f
commit 0f53349ce9
No known key found for this signature in database
GPG Key ID: A38C8E571FA4621E
2 changed files with 14 additions and 6 deletions

View File

@ -184,7 +184,9 @@ object Command {
} }
) )
def process(command: String, state: State, onParseError: String => Unit = _ => ()): State = { // overload instead of default parameter to keep binary compatibility
def process(command: String, state: State): State = process(command, state, _ => ())
def process(command: String, state: State, onParseError: String => Unit): State = {
(if (command.contains(";")) parse(command, state.combinedParser) (if (command.contains(";")) parse(command, state.combinedParser)
else parse(command, state.nonMultiParser)) match { else parse(command, state.nonMultiParser)) match {
case Right(s) => s() // apply command. command side effects happen here case Right(s) => s() // apply command. command side effects happen here

View File

@ -16,7 +16,13 @@ import sbt.internal.ShutdownHooks
import sbt.internal.langserver.ErrorCodes import sbt.internal.langserver.ErrorCodes
import sbt.internal.protocol.JsonRpcResponseError import sbt.internal.protocol.JsonRpcResponseError
import sbt.internal.nio.CheckBuildSources.CheckBuildSourcesKey import sbt.internal.nio.CheckBuildSources.CheckBuildSourcesKey
import sbt.internal.util.{AttributeKey, ErrorHandling, GlobalLogBacking, Prompt, Terminal => ITerminal} import sbt.internal.util.{
AttributeKey,
ErrorHandling,
GlobalLogBacking,
Prompt,
Terminal => ITerminal
}
import sbt.internal.{ ShutdownHooks, TaskProgress } import sbt.internal.{ ShutdownHooks, TaskProgress }
import sbt.io.{ IO, Using } import sbt.io.{ IO, Using }
import sbt.protocol._ import sbt.protocol._