File tree 1 file changed +11
-0
lines changed
compiler/src/dotty/tools/debug
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,17 @@ import dotty.tools.dotc.core.Contexts.Context
5
5
import dotty .tools .dotc .core .Phases .Phase
6
6
import dotty .tools .dotc .transform .ElimByName
7
7
8
+ /**
9
+ * The expression compiler powers the debug console in Metals and the IJ Scala plugin,
10
+ * enabling evaluation of arbitrary Scala expressions at runtime (even macros).
11
+ * It produces class files that can be loaded by the running Scala program,
12
+ * to compute the evaluation output.
13
+ *
14
+ * To do so, it extends the Compiler with 3 phases:
15
+ * - InsertExpression: parses and inserts the expression in the original source tree
16
+ * - ExtractExpression: extract the typed expression and places it in the new expression class
17
+ * - ResolveReflectEval: resolves local variables or inacessible members using reflection calls
18
+ */
8
19
class ExpressionCompiler (config : ExpressionCompilerConfig ) extends Compiler :
9
20
10
21
override protected def frontendPhases : List [List [Phase ]] =
You can’t perform that action at this time.
0 commit comments