FIR: remove beforeRunningAllComponentsOnElement/beforeRunningSingleComponentOnElement from AbstractDiagnosticCollectorVisitor
This commit is contained in:
-3
@@ -29,9 +29,6 @@ abstract class AbstractDiagnosticCollectorVisitor(
|
|||||||
protected val components: List<AbstractDiagnosticCollectorComponent>,
|
protected val components: List<AbstractDiagnosticCollectorComponent>,
|
||||||
) : FirDefaultVisitor<Unit, Nothing?>() {
|
) : FirDefaultVisitor<Unit, Nothing?>() {
|
||||||
|
|
||||||
protected open fun beforeRunningAllComponentsOnElement(element: FirElement) {}
|
|
||||||
protected open fun beforeRunningSingleComponentOnElement(element: FirElement) {}
|
|
||||||
|
|
||||||
protected open fun shouldVisitDeclaration(declaration: FirDeclaration) = true
|
protected open fun shouldVisitDeclaration(declaration: FirDeclaration) = true
|
||||||
protected open fun onDeclarationExit(declaration: FirDeclaration) {}
|
protected open fun onDeclarationExit(declaration: FirDeclaration) {}
|
||||||
|
|
||||||
|
|||||||
-2
@@ -19,9 +19,7 @@ open class CheckerRunningDiagnosticCollectorVisitor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun runComponents(element: FirElement) {
|
override fun runComponents(element: FirElement) {
|
||||||
beforeRunningAllComponentsOnElement(element)
|
|
||||||
components.forEach {
|
components.forEach {
|
||||||
beforeRunningSingleComponentOnElement(element)
|
|
||||||
element.accept(it, context)
|
element.accept(it, context)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -18,10 +18,6 @@ internal open class FirIdeDiagnosticVisitor(
|
|||||||
) : CheckerRunningDiagnosticCollectorVisitor(context, components) {
|
) : CheckerRunningDiagnosticCollectorVisitor(context, components) {
|
||||||
private val beforeElementDiagnosticCollectionHandler = context.session.beforeElementDiagnosticCollectionHandler
|
private val beforeElementDiagnosticCollectionHandler = context.session.beforeElementDiagnosticCollectionHandler
|
||||||
|
|
||||||
override fun beforeRunningSingleComponentOnElement(element: FirElement) {
|
|
||||||
checkCanceled()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun goToNestedDeclarations(element: FirElement) {
|
override fun goToNestedDeclarations(element: FirElement) {
|
||||||
if (element is FirDeclaration) {
|
if (element is FirDeclaration) {
|
||||||
beforeElementDiagnosticCollectionHandler?.beforeGoingNestedDeclaration(element, context)
|
beforeElementDiagnosticCollectionHandler?.beforeGoingNestedDeclaration(element, context)
|
||||||
@@ -29,7 +25,11 @@ internal open class FirIdeDiagnosticVisitor(
|
|||||||
super.goToNestedDeclarations(element)
|
super.goToNestedDeclarations(element)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun beforeRunningAllComponentsOnElement(element: FirElement) {
|
override fun runComponents(element: FirElement) {
|
||||||
beforeElementDiagnosticCollectionHandler?.beforeCollectingForElement(element)
|
beforeElementDiagnosticCollectionHandler?.beforeCollectingForElement(element)
|
||||||
|
components.forEach {
|
||||||
|
checkCanceled()
|
||||||
|
element.accept(it, context)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user