|
1 | 1 | package replpp.server
|
2 | 2 |
|
3 |
| -import dotty.tools.dotc.config.Printers.config |
4 | 3 | import dotty.tools.repl.State
|
5 | 4 | import org.slf4j.{Logger, LoggerFactory}
|
6 | 5 | import replpp.Colors.BlackWhite
|
7 |
| -import replpp.{Config, ReplDriverBase, pwd} |
| 6 | +import replpp.{ReplDriverBase, pwd} |
8 | 7 |
|
9 | 8 | import java.io.*
|
10 | 9 | import java.nio.charset.StandardCharsets
|
11 | 10 | import java.util.UUID
|
12 |
| -import java.util.concurrent.{BlockingQueue, Executors, LinkedBlockingQueue, Semaphore} |
| 11 | +import java.util.concurrent.Executors |
13 | 12 | import scala.concurrent.duration.Duration
|
14 |
| -import scala.concurrent.impl.Promise |
15 | 13 | import scala.concurrent.{Await, ExecutionContext, ExecutionContextExecutorService, Future}
|
16 |
| -import scala.util.{Failure, Success} |
17 | 14 |
|
18 |
| -class EmbeddedRepl(predefLines: IterableOnce[String] = Seq.empty) { |
| 15 | +class EmbeddedRepl(compilerArgs: Array[String], predefLines: IterableOnce[String] = Seq.empty) { |
19 | 16 | private val logger: Logger = LoggerFactory.getLogger(getClass)
|
20 | 17 |
|
21 | 18 | /** repl and compiler output ends up in this replOutputStream */
|
22 | 19 | private val replOutputStream = new ByteArrayOutputStream()
|
23 | 20 |
|
24 | 21 | private val replDriver: ReplDriver = {
|
25 |
| - val inheritedClasspath = System.getProperty("java.class.path") |
26 |
| - val compilerArgs = Array( |
27 |
| - "-classpath", inheritedClasspath, |
28 |
| - "-explain", // verbose scalac error messages |
29 |
| - "-deprecation", |
30 |
| - "-color", "never" |
31 |
| - ) |
32 | 22 | new ReplDriver(compilerArgs, new PrintStream(replOutputStream), classLoader = None)
|
33 | 23 | }
|
34 | 24 |
|
|
0 commit comments