Skip to content

Commit 2fd10d9

Browse files
committed
Add instructions on how to add initialCommands to REPL
1 parent 2de82b9 commit 2fd10d9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

sbt-bridge/src/xsbt/ConsoleInterface.scala

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,24 @@ class ConsoleInterface {
1919
def run(args: Array[String],
2020
bootClasspathString: String,
2121
classpathString: String,
22+
// TODO: initial commands needs to be run under some form of special
23+
// "silent" mode in the REPL. I.e. the effects should be had without
24+
// any visual output.
25+
//
26+
// To do this we can use the `run` interface to the `ReplDriver` and
27+
// pass it a special instance of `ParseResult` like `Silently(res: ParseResult)`
28+
// and then observe the effects without printing to `ReplDriver#out`
29+
//
30+
// This way, the REPL can offer feedback on invalid commands but
31+
// still function without stringly logic.
32+
//
33+
// This same principle can be applied to `cleanupCommands` and
34+
// `bindValues`
35+
//
36+
// Steps:
37+
//
38+
// 1. Introduce `case class Silent(res: ParseResult) extends ParseResult`
39+
// 2. Perform all steps in `interpret` as usual without printing to `out`
2240
initialCommands: String,
2341
cleanupCommands: String,
2442
loader: ClassLoader,

0 commit comments

Comments
 (0)