aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Contexts.scala
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2015-12-02 16:26:12 +0100
committerGuillaume Martres <smarter@ubuntu.com>2015-12-03 14:58:12 +0100
commitccf7f8ae4e09c1e5cbbc52d64ff0358203d29d5c (patch)
tree079ef70f2596fd65798164ce527fd8c204d34791 /src/dotty/tools/dotc/core/Contexts.scala
parent47da63278147634c75ecd3d0b5f3709a8de2a2db (diff)
downloaddotty-ccf7f8ae4e09c1e5cbbc52d64ff0358203d29d5c.tar.gz
dotty-ccf7f8ae4e09c1e5cbbc52d64ff0358203d29d5c.tar.bz2
dotty-ccf7f8ae4e09c1e5cbbc52d64ff0358203d29d5c.zip
Add initial CompilerCallback implementation for IntelliJ
This adds some simple callbacks to Dotty that should be enough to get basic integration from IntelliJ.
Diffstat (limited to 'src/dotty/tools/dotc/core/Contexts.scala')
-rw-r--r--src/dotty/tools/dotc/core/Contexts.scala15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/Contexts.scala b/src/dotty/tools/dotc/core/Contexts.scala
index 522240b0f..1a471537e 100644
--- a/src/dotty/tools/dotc/core/Contexts.scala
+++ b/src/dotty/tools/dotc/core/Contexts.scala
@@ -72,11 +72,23 @@ object Contexts {
def next = { val c = current; current = current.outer; c }
}
+ /** Set the compiler callback, shared by all contexts with the same `base` */
+ def setCompilerCallback(callback: CompilerCallback): this.type = {
+ base.compilerCallback = callback; this
+ }
+
/** The outer context */
private[this] var _outer: Context = _
protected def outer_=(outer: Context) = _outer = outer
def outer: Context = _outer
+ // protected def compilerCallback_=(callback: CompilerCallback) =
+ // _compilerCallback = callback
+ // def compilerCallback: CompilerCallback = _compilerCallback
+ // def setCompilerCallback(callback: CompilerCallback): this.type = {
+ // this.compilerCallback = callback; this
+ // }
+
/** The current context */
private[this] var _period: Period = _
protected def period_=(period: Period) = {
@@ -525,6 +537,9 @@ object Contexts {
/** The essential mutable state of a context base, collected into a common class */
class ContextState {
+ /** The compiler callback implementation, or null if unset */
+ var compilerCallback: CompilerCallback = _
+
// Symbols state
/** A counter for unique ids */