src/Tools/jEdit/jedit_main/scala_console.scala
author wenzelm
Thu, 21 Apr 2022 11:28:50 +0200
changeset 75442 d5041b68a237
parent 75394 42267c650205
child 75443 d6f2fbdc6322
permissions -rw-r--r--
clarified signature;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
73987
fc363a3b690a build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents: 73702
diff changeset
     1
/*  Title:      Tools/jEdit/jedit_main/scala_console.scala
36760
b82a698ef6c9 tuned headers;
wenzelm
parents: 36015
diff changeset
     2
    Author:     Makarius
b82a698ef6c9 tuned headers;
wenzelm
parents: 36015
diff changeset
     3
b82a698ef6c9 tuned headers;
wenzelm
parents: 36015
diff changeset
     4
Scala instance of Console plugin.
b82a698ef6c9 tuned headers;
wenzelm
parents: 36015
diff changeset
     5
*/
34841
2ada58650469 some attempts at Scala console plugin;
wenzelm
parents:
diff changeset
     6
73987
fc363a3b690a build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents: 73702
diff changeset
     7
package isabelle.jedit_main
34841
2ada58650469 some attempts at Scala console plugin;
wenzelm
parents:
diff changeset
     8
2ada58650469 some attempts at Scala console plugin;
wenzelm
parents:
diff changeset
     9
36015
6111de7c916a adapted to Scala 2.8.0 Beta 1;
wenzelm
parents: 34857
diff changeset
    10
import isabelle._
73987
fc363a3b690a build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents: 73702
diff changeset
    11
import isabelle.jedit._
36015
6111de7c916a adapted to Scala 2.8.0 Beta 1;
wenzelm
parents: 34857
diff changeset
    12
34844
92ea2174ea78 more precise prompt etc.;
wenzelm
parents: 34841
diff changeset
    13
import console.{Console, ConsolePane, Shell, Output}
71863
e95ea6956df3 unused;
wenzelm
parents: 71861
diff changeset
    14
import org.gjt.sp.jedit.JARClassLoader
e95ea6956df3 unused;
wenzelm
parents: 71861
diff changeset
    15
import java.io.{OutputStream, Writer, PrintWriter}
34841
2ada58650469 some attempts at Scala console plugin;
wenzelm
parents:
diff changeset
    16
2ada58650469 some attempts at Scala console plugin;
wenzelm
parents:
diff changeset
    17
75393
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 74037
diff changeset
    18
class Scala_Console extends Shell("Scala") {
57612
990ffb84489b clarified module name: facilitate alternative GUI frameworks;
wenzelm
parents: 57609
diff changeset
    19
  /* global state -- owned by GUI thread */
34849
96bcb91b45ce bind "session";
wenzelm
parents: 34846
diff changeset
    20
57609
943dbbbf7ad5 some robustification of console output;
wenzelm
parents: 57603
diff changeset
    21
  @volatile private var interpreters = Map.empty[Console, Interpreter]
34841
2ada58650469 some attempts at Scala console plugin;
wenzelm
parents:
diff changeset
    22
57609
943dbbbf7ad5 some robustification of console output;
wenzelm
parents: 57603
diff changeset
    23
  @volatile private var global_console: Console = null
943dbbbf7ad5 some robustification of console output;
wenzelm
parents: 57603
diff changeset
    24
  @volatile private var global_out: Output = null
943dbbbf7ad5 some robustification of console output;
wenzelm
parents: 57603
diff changeset
    25
  @volatile private var global_err: Output = null
34841
2ada58650469 some attempts at Scala console plugin;
wenzelm
parents:
diff changeset
    26
75393
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 74037
diff changeset
    27
  private val console_stream = new OutputStream {
65876
wenzelm
parents: 62443
diff changeset
    28
    val buf = new StringBuilder(100)
wenzelm
parents: 62443
diff changeset
    29
75393
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 74037
diff changeset
    30
    override def flush(): Unit = {
73367
77ef8bef0593 clarified signature --- fewer warnings;
wenzelm
parents: 73340
diff changeset
    31
      val s = buf.synchronized { val s = buf.toString; buf.clear(); s }
56833
d0a57abc71f8 clarified synchronization and exception handling;
wenzelm
parents: 56832
diff changeset
    32
      val str = UTF8.decode_permissive(s)
57612
990ffb84489b clarified module name: facilitate alternative GUI frameworks;
wenzelm
parents: 57609
diff changeset
    33
      GUI_Thread.later {
74023
fd4b4385ad3c more robust: for the sake of Isabelle.app on macOS;
wenzelm
parents: 73987
diff changeset
    34
        if (global_out == null) java.lang.System.out.print(str)
56834
a752f065f3d3 fork Scala interpreter thread, independently of Swing_Thread;
wenzelm
parents: 56833
diff changeset
    35
        else global_out.writeAttrs(null, str)
a752f065f3d3 fork Scala interpreter thread, independently of Swing_Thread;
wenzelm
parents: 56833
diff changeset
    36
      }
73702
7202e12cb324 tuned signature --- following hints by IntelliJ IDEA;
wenzelm
parents: 73367
diff changeset
    37
      Time.seconds(0.01).sleep()  // FIXME adhoc delay to avoid loosing output
34850
fdd560e80264 redirect scala.Console output during interpretation;
wenzelm
parents: 34849
diff changeset
    38
    }
65876
wenzelm
parents: 62443
diff changeset
    39
73340
0ffcad1f6130 tuned --- fewer warnings;
wenzelm
parents: 71868
diff changeset
    40
    override def close(): Unit = flush()
65876
wenzelm
parents: 62443
diff changeset
    41
75393
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 74037
diff changeset
    42
    def write(byte: Int): Unit = {
56833
d0a57abc71f8 clarified synchronization and exception handling;
wenzelm
parents: 56832
diff changeset
    43
      val c = byte.toChar
57609
943dbbbf7ad5 some robustification of console output;
wenzelm
parents: 57603
diff changeset
    44
      buf.synchronized { buf.append(c) }
56833
d0a57abc71f8 clarified synchronization and exception handling;
wenzelm
parents: 56832
diff changeset
    45
      if (c == '\n') flush()
d0a57abc71f8 clarified synchronization and exception handling;
wenzelm
parents: 56832
diff changeset
    46
    }
34850
fdd560e80264 redirect scala.Console output during interpretation;
wenzelm
parents: 34849
diff changeset
    47
  }
fdd560e80264 redirect scala.Console output during interpretation;
wenzelm
parents: 34849
diff changeset
    48
75393
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 74037
diff changeset
    49
  private val console_writer = new Writer {
73340
0ffcad1f6130 tuned --- fewer warnings;
wenzelm
parents: 71868
diff changeset
    50
    def flush(): Unit = console_stream.flush()
0ffcad1f6130 tuned --- fewer warnings;
wenzelm
parents: 71868
diff changeset
    51
    def close(): Unit = console_stream.flush()
34850
fdd560e80264 redirect scala.Console output during interpretation;
wenzelm
parents: 34849
diff changeset
    52
75393
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 74037
diff changeset
    53
    def write(cbuf: Array[Char], off: Int, len: Int): Unit = {
65877
6eb1a3f7012f more uniform line-oriented output, notably for scala-2.12.2 REPL which emits "\n" separately;
wenzelm
parents: 65876
diff changeset
    54
      if (len > 0) {
6eb1a3f7012f more uniform line-oriented output, notably for scala-2.12.2 REPL which emits "\n" separately;
wenzelm
parents: 65876
diff changeset
    55
        UTF8.bytes(new String(cbuf.slice(off, off + len))).foreach(console_stream.write(_))
6eb1a3f7012f more uniform line-oriented output, notably for scala-2.12.2 REPL which emits "\n" separately;
wenzelm
parents: 65876
diff changeset
    56
      }
34850
fdd560e80264 redirect scala.Console output during interpretation;
wenzelm
parents: 34849
diff changeset
    57
    }
fdd560e80264 redirect scala.Console output during interpretation;
wenzelm
parents: 34849
diff changeset
    58
  }
fdd560e80264 redirect scala.Console output during interpretation;
wenzelm
parents: 34849
diff changeset
    59
75393
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 74037
diff changeset
    60
  private def with_console[A](console: Console, out: Output, err: Output)(e: => A): A = {
34844
92ea2174ea78 more precise prompt etc.;
wenzelm
parents: 34841
diff changeset
    61
    global_console = console
92ea2174ea78 more precise prompt etc.;
wenzelm
parents: 34841
diff changeset
    62
    global_out = out
92ea2174ea78 more precise prompt etc.;
wenzelm
parents: 34841
diff changeset
    63
    global_err = if (err == null) out else err
56833
d0a57abc71f8 clarified synchronization and exception handling;
wenzelm
parents: 56832
diff changeset
    64
    try {
56832
93f05fa757dd more redirection;
wenzelm
parents: 55621
diff changeset
    65
      scala.Console.withErr(console_stream) {
93f05fa757dd more redirection;
wenzelm
parents: 55621
diff changeset
    66
        scala.Console.withOut(console_stream) { e }
93f05fa757dd more redirection;
wenzelm
parents: 55621
diff changeset
    67
      }
93f05fa757dd more redirection;
wenzelm
parents: 55621
diff changeset
    68
    }
56833
d0a57abc71f8 clarified synchronization and exception handling;
wenzelm
parents: 56832
diff changeset
    69
    finally {
74037
c13198575f75 tuned --- based on hints by IntelliJ IDEA;
wenzelm
parents: 74023
diff changeset
    70
      console_stream.flush()
56833
d0a57abc71f8 clarified synchronization and exception handling;
wenzelm
parents: 56832
diff changeset
    71
      global_console = null
d0a57abc71f8 clarified synchronization and exception handling;
wenzelm
parents: 56832
diff changeset
    72
      global_out = null
d0a57abc71f8 clarified synchronization and exception handling;
wenzelm
parents: 56832
diff changeset
    73
      global_err = null
d0a57abc71f8 clarified synchronization and exception handling;
wenzelm
parents: 56832
diff changeset
    74
    }
34844
92ea2174ea78 more precise prompt etc.;
wenzelm
parents: 34841
diff changeset
    75
  }
92ea2174ea78 more precise prompt etc.;
wenzelm
parents: 34841
diff changeset
    76
75393
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 74037
diff changeset
    77
  private def report_error(str: String): Unit = {
67178
70576478bda9 avoid println with its extra CR on Windows;
wenzelm
parents: 66923
diff changeset
    78
    if (global_console == null || global_err == null) isabelle.Output.writeln(str)
57612
990ffb84489b clarified module name: facilitate alternative GUI frameworks;
wenzelm
parents: 57609
diff changeset
    79
    else GUI_Thread.later { global_err.print(global_console.getErrorColor, str) }
34846
ca76b3978540 pass all jEdit jars to compiler as classpath -- to enable proper referencing of application name space;
wenzelm
parents: 34845
diff changeset
    80
  }
ca76b3978540 pass all jEdit jars to compiler as classpath -- to enable proper referencing of application name space;
wenzelm
parents: 34845
diff changeset
    81
34841
2ada58650469 some attempts at Scala console plugin;
wenzelm
parents:
diff changeset
    82
56834
a752f065f3d3 fork Scala interpreter thread, independently of Swing_Thread;
wenzelm
parents: 56833
diff changeset
    83
  /* interpreter thread */
34841
2ada58650469 some attempts at Scala console plugin;
wenzelm
parents:
diff changeset
    84
56836
69531d86d77e more sensible interrupt of interpreter, when the user pushes Cancel button;
wenzelm
parents: 56834
diff changeset
    85
  private abstract class Request
56834
a752f065f3d3 fork Scala interpreter thread, independently of Swing_Thread;
wenzelm
parents: 56833
diff changeset
    86
  private case class Start(console: Console) extends Request
a752f065f3d3 fork Scala interpreter thread, independently of Swing_Thread;
wenzelm
parents: 56833
diff changeset
    87
  private case class Execute(console: Console, out: Output, err: Output, command: String)
a752f065f3d3 fork Scala interpreter thread, independently of Swing_Thread;
wenzelm
parents: 56833
diff changeset
    88
    extends Request
a752f065f3d3 fork Scala interpreter thread, independently of Swing_Thread;
wenzelm
parents: 56833
diff changeset
    89
75393
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 74037
diff changeset
    90
  private class Interpreter {
61590
wenzelm
parents: 61558
diff changeset
    91
    private val running = Synchronized[Option[Thread]](None)
75394
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
    92
    def interrupt(): Unit = running.change({ opt => opt.foreach(_.interrupt()); opt })
56836
69531d86d77e more sensible interrupt of interpreter, when the user pushes Cancel button;
wenzelm
parents: 56834
diff changeset
    93
71868
06ec50d9fc0a clarified signature;
wenzelm
parents: 71864
diff changeset
    94
    private val interp =
75442
d5041b68a237 clarified signature;
wenzelm
parents: 75394
diff changeset
    95
      Scala.Compiler.context(
d5041b68a237 clarified signature;
wenzelm
parents: 75394
diff changeset
    96
          error = report_error,
d5041b68a237 clarified signature;
wenzelm
parents: 75394
diff changeset
    97
          jar_dirs = JEdit_Lib.directories,
d5041b68a237 clarified signature;
wenzelm
parents: 75394
diff changeset
    98
          class_loader = Some(new JARClassLoader)).
d5041b68a237 clarified signature;
wenzelm
parents: 75394
diff changeset
    99
        interpreter(new PrintWriter(console_writer, true))
56834
a752f065f3d3 fork Scala interpreter thread, independently of Swing_Thread;
wenzelm
parents: 56833
diff changeset
   100
75393
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 74037
diff changeset
   101
    val thread: Consumer_Thread[Request] = Consumer_Thread.fork("Scala_Console") {
56834
a752f065f3d3 fork Scala interpreter thread, independently of Swing_Thread;
wenzelm
parents: 56833
diff changeset
   102
      case Start(console) =>
a752f065f3d3 fork Scala interpreter thread, independently of Swing_Thread;
wenzelm
parents: 56833
diff changeset
   103
        interp.bind("view", "org.gjt.sp.jedit.View", console.getView)
a752f065f3d3 fork Scala interpreter thread, independently of Swing_Thread;
wenzelm
parents: 56833
diff changeset
   104
        interp.bind("console", "console.Console", console)
57603
0f58af858813 more default imports;
wenzelm
parents: 56836
diff changeset
   105
        interp.interpret("import isabelle._; import isabelle.jedit._")
56834
a752f065f3d3 fork Scala interpreter thread, independently of Swing_Thread;
wenzelm
parents: 56833
diff changeset
   106
        true
34850
fdd560e80264 redirect scala.Console output during interpretation;
wenzelm
parents: 34849
diff changeset
   107
56834
a752f065f3d3 fork Scala interpreter thread, independently of Swing_Thread;
wenzelm
parents: 56833
diff changeset
   108
      case Execute(console, out, err, command) =>
a752f065f3d3 fork Scala interpreter thread, independently of Swing_Thread;
wenzelm
parents: 56833
diff changeset
   109
        with_console(console, out, err) {
56836
69531d86d77e more sensible interrupt of interpreter, when the user pushes Cancel button;
wenzelm
parents: 56834
diff changeset
   110
          try {
69531d86d77e more sensible interrupt of interpreter, when the user pushes Cancel button;
wenzelm
parents: 56834
diff changeset
   111
            running.change(_ => Some(Thread.currentThread()))
69531d86d77e more sensible interrupt of interpreter, when the user pushes Cancel button;
wenzelm
parents: 56834
diff changeset
   112
            interp.interpret(command)
69531d86d77e more sensible interrupt of interpreter, when the user pushes Cancel button;
wenzelm
parents: 56834
diff changeset
   113
          }
69531d86d77e more sensible interrupt of interpreter, when the user pushes Cancel button;
wenzelm
parents: 56834
diff changeset
   114
          finally {
69531d86d77e more sensible interrupt of interpreter, when the user pushes Cancel button;
wenzelm
parents: 56834
diff changeset
   115
            running.change(_ => None)
71700
6c39c3be85df clarified signature;
wenzelm
parents: 71684
diff changeset
   116
            Exn.Interrupt.dispose()
56836
69531d86d77e more sensible interrupt of interpreter, when the user pushes Cancel button;
wenzelm
parents: 56834
diff changeset
   117
          }
57612
990ffb84489b clarified module name: facilitate alternative GUI frameworks;
wenzelm
parents: 57609
diff changeset
   118
          GUI_Thread.later {
56834
a752f065f3d3 fork Scala interpreter thread, independently of Swing_Thread;
wenzelm
parents: 56833
diff changeset
   119
            if (err != null) err.commandDone()
a752f065f3d3 fork Scala interpreter thread, independently of Swing_Thread;
wenzelm
parents: 56833
diff changeset
   120
            out.commandDone()
a752f065f3d3 fork Scala interpreter thread, independently of Swing_Thread;
wenzelm
parents: 56833
diff changeset
   121
          }
a752f065f3d3 fork Scala interpreter thread, independently of Swing_Thread;
wenzelm
parents: 56833
diff changeset
   122
          true
a752f065f3d3 fork Scala interpreter thread, independently of Swing_Thread;
wenzelm
parents: 56833
diff changeset
   123
        }
a752f065f3d3 fork Scala interpreter thread, independently of Swing_Thread;
wenzelm
parents: 56833
diff changeset
   124
    }
a752f065f3d3 fork Scala interpreter thread, independently of Swing_Thread;
wenzelm
parents: 56833
diff changeset
   125
  }
a752f065f3d3 fork Scala interpreter thread, independently of Swing_Thread;
wenzelm
parents: 56833
diff changeset
   126
a752f065f3d3 fork Scala interpreter thread, independently of Swing_Thread;
wenzelm
parents: 56833
diff changeset
   127
a752f065f3d3 fork Scala interpreter thread, independently of Swing_Thread;
wenzelm
parents: 56833
diff changeset
   128
  /* jEdit console methods */
a752f065f3d3 fork Scala interpreter thread, independently of Swing_Thread;
wenzelm
parents: 56833
diff changeset
   129
75393
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 74037
diff changeset
   130
  override def openConsole(console: Console): Unit = {
56836
69531d86d77e more sensible interrupt of interpreter, when the user pushes Cancel button;
wenzelm
parents: 56834
diff changeset
   131
    val interp = new Interpreter
69531d86d77e more sensible interrupt of interpreter, when the user pushes Cancel button;
wenzelm
parents: 56834
diff changeset
   132
    interp.thread.send(Start(console))
34845
6d64de27efa5 provide some bindings of jEdit values;
wenzelm
parents: 34844
diff changeset
   133
    interpreters += (console -> interp)
34841
2ada58650469 some attempts at Scala console plugin;
wenzelm
parents:
diff changeset
   134
  }
2ada58650469 some attempts at Scala console plugin;
wenzelm
parents:
diff changeset
   135
75393
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 74037
diff changeset
   136
  override def closeConsole(console: Console): Unit = {
56834
a752f065f3d3 fork Scala interpreter thread, independently of Swing_Thread;
wenzelm
parents: 56833
diff changeset
   137
    interpreters.get(console) match {
a752f065f3d3 fork Scala interpreter thread, independently of Swing_Thread;
wenzelm
parents: 56833
diff changeset
   138
      case Some(interp) =>
73367
77ef8bef0593 clarified signature --- fewer warnings;
wenzelm
parents: 73340
diff changeset
   139
        interp.interrupt()
77ef8bef0593 clarified signature --- fewer warnings;
wenzelm
parents: 73340
diff changeset
   140
        interp.thread.shutdown()
56834
a752f065f3d3 fork Scala interpreter thread, independently of Swing_Thread;
wenzelm
parents: 56833
diff changeset
   141
        interpreters -= console
a752f065f3d3 fork Scala interpreter thread, independently of Swing_Thread;
wenzelm
parents: 56833
diff changeset
   142
      case None =>
a752f065f3d3 fork Scala interpreter thread, independently of Swing_Thread;
wenzelm
parents: 56833
diff changeset
   143
    }
34841
2ada58650469 some attempts at Scala console plugin;
wenzelm
parents:
diff changeset
   144
  }
2ada58650469 some attempts at Scala console plugin;
wenzelm
parents:
diff changeset
   145
75393
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 74037
diff changeset
   146
  override def printInfoMessage(out: Output): Unit = {
34849
96bcb91b45ce bind "session";
wenzelm
parents: 34846
diff changeset
   147
    out.print(null,
96bcb91b45ce bind "session";
wenzelm
parents: 34846
diff changeset
   148
     "This shell evaluates Isabelle/Scala expressions.\n\n" +
57848
f68cda7c85d4 tuned message;
wenzelm
parents: 57612
diff changeset
   149
     "The contents of package isabelle and isabelle.jedit are imported.\n" +
34849
96bcb91b45ce bind "session";
wenzelm
parents: 34846
diff changeset
   150
     "The following special toplevel bindings are provided:\n" +
50205
788c8263e634 renamed main plugin object to PIDE;
wenzelm
parents: 50203
diff changeset
   151
     "  view    -- current jEdit/Swing view (e.g. view.getBuffer, view.getTextArea)\n" +
788c8263e634 renamed main plugin object to PIDE;
wenzelm
parents: 50203
diff changeset
   152
     "  console -- jEdit Console plugin\n" +
55621
8d69c15b6fb9 added PIDE.snapshot, PIDE.rendering for convenience;
wenzelm
parents: 55618
diff changeset
   153
     "  PIDE    -- Isabelle/PIDE plugin (e.g. PIDE.session, PIDE.snapshot, PIDE.rendering)\n")
34849
96bcb91b45ce bind "session";
wenzelm
parents: 34846
diff changeset
   154
  }
96bcb91b45ce bind "session";
wenzelm
parents: 34846
diff changeset
   155
75393
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 74037
diff changeset
   156
  override def printPrompt(console: Console, out: Output): Unit = {
34844
92ea2174ea78 more precise prompt etc.;
wenzelm
parents: 34841
diff changeset
   157
    out.writeAttrs(ConsolePane.colorAttributes(console.getInfoColor), "scala>")
37175
be764a7adb10 eliminated hard tabs;
wenzelm
parents: 36760
diff changeset
   158
    out.writeAttrs(ConsolePane.colorAttributes(console.getPlainColor), " ")
be764a7adb10 eliminated hard tabs;
wenzelm
parents: 36760
diff changeset
   159
  }
34841
2ada58650469 some attempts at Scala console plugin;
wenzelm
parents:
diff changeset
   160
73340
0ffcad1f6130 tuned --- fewer warnings;
wenzelm
parents: 71868
diff changeset
   161
  override def execute(
75393
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 74037
diff changeset
   162
    console: Console,
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 74037
diff changeset
   163
    input: String,
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 74037
diff changeset
   164
    out: Output,
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 74037
diff changeset
   165
    err: Output, command: String
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 74037
diff changeset
   166
  ): Unit = {
56836
69531d86d77e more sensible interrupt of interpreter, when the user pushes Cancel button;
wenzelm
parents: 56834
diff changeset
   167
    interpreters(console).thread.send(Execute(console, out, err, command))
34841
2ada58650469 some attempts at Scala console plugin;
wenzelm
parents:
diff changeset
   168
  }
34849
96bcb91b45ce bind "session";
wenzelm
parents: 34846
diff changeset
   169
73340
0ffcad1f6130 tuned --- fewer warnings;
wenzelm
parents: 71868
diff changeset
   170
  override def stop(console: Console): Unit =
73367
77ef8bef0593 clarified signature --- fewer warnings;
wenzelm
parents: 73340
diff changeset
   171
    interpreters.get(console).foreach(_.interrupt())
34841
2ada58650469 some attempts at Scala console plugin;
wenzelm
parents:
diff changeset
   172
}