Skip to content

Commit b8c33c7

Browse files
committed
Adjust after feedback
1 parent d5414d6 commit b8c33c7

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

tasty-inspector/src/scala/tasty/inspector/TastyInspector.scala

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import dotty.tools.dotc.core.Mode
1111
import dotty.tools.dotc.core.Phases.Phase
1212
import dotty.tools.dotc.fromtasty._
1313
import dotty.tools.dotc.util.ClasspathFromClassloader
14+
import dotty.tools.dotc.CompilationUnit
15+
import dotty.tools.unsupported
1416

1517
import java.io.File.pathSeparator
1618

@@ -21,7 +23,7 @@ trait TastyInspector:
2123
protected def processCompilationUnit(using QuoteContext)(root: qctx.reflect.Tree): Unit
2224

2325
/** Called after all compilation units are processed */
24-
protected def finishProcessingCompilationUnits(using QuoteContext): Unit = ()
26+
protected def postProcess(using QuoteContext): Unit = ()
2527

2628
/** Load and process TASTy files using TASTy reflect
2729
*
@@ -97,15 +99,13 @@ trait TastyInspector:
9799

98100
override def phaseName: String = "tastyInspectorFinish"
99101

100-
override def run(implicit ctx: Context): Unit =
101-
if !alreadyRan then
102-
try
103-
val qctx = QuoteContextImpl()
104-
self.finishProcessingCompilationUnits(using qctx)
105-
finally
106-
alreadyRan = true
107-
108-
var alreadyRan = false
102+
override def runOn(units: List[CompilationUnit])(using Context): List[CompilationUnit] =
103+
val qctx = QuoteContextImpl()
104+
self.postProcess(using qctx)
105+
units
106+
107+
override def run(implicit ctx: Context): Unit = unsupported("run")
108+
109109
end TastyInspectorFinishPhase
110110

111111
val currentClasspath = ClasspathFromClassloader(getClass.getClassLoader)

0 commit comments

Comments
 (0)