FIR: rename goToNestedDeclarations -> visitNestedElements

This commit is contained in:
Ilya Kirillov
2021-04-16 18:04:41 +02:00
parent eed143d17b
commit ea233cddf8
4 changed files with 12 additions and 12 deletions
@@ -32,7 +32,7 @@ abstract class AbstractDiagnosticCollectorVisitor(
protected open fun shouldVisitDeclaration(declaration: FirDeclaration) = true
protected open fun onDeclarationExit(declaration: FirDeclaration) {}
protected abstract fun goToNestedDeclarations(element: FirElement)
protected abstract fun visitNestedElements(element: FirElement)
protected abstract fun runComponents(element: FirElement)
override fun visitElement(element: FirElement, data: Nothing?) {
@@ -41,13 +41,13 @@ abstract class AbstractDiagnosticCollectorVisitor(
return
}
runComponents(element)
goToNestedDeclarations(element)
visitNestedElements(element)
}
override fun visitAnnotationContainer(annotationContainer: FirAnnotationContainer, data: Nothing?) {
withSuppressedDiagnostics(annotationContainer) {
runComponents(annotationContainer)
goToNestedDeclarations(annotationContainer)
visitNestedElements(annotationContainer)
}
}
@@ -161,7 +161,7 @@ abstract class AbstractDiagnosticCollectorVisitor(
if (typeRef.source != null && typeRef.source?.kind !is FirFakeSourceElementKind) {
withSuppressedDiagnostics(typeRef) {
runComponents(typeRef)
goToNestedDeclarations(typeRef)
visitNestedElements(typeRef)
}
}
}
@@ -185,7 +185,7 @@ abstract class AbstractDiagnosticCollectorVisitor(
protected inline fun visitWithDeclaration(
declaration: FirDeclaration,
block: () -> Unit = { goToNestedDeclarations(declaration) }
block: () -> Unit = { visitNestedElements(declaration) }
) {
if (shouldVisitDeclaration(declaration)) {
runComponents(declaration)
@@ -203,7 +203,7 @@ abstract class AbstractDiagnosticCollectorVisitor(
declaration,
receiverTypeRef?.coneTypeSafe()
) {
goToNestedDeclarations(declaration)
visitNestedElements(declaration)
}
}
}
@@ -211,14 +211,14 @@ abstract class AbstractDiagnosticCollectorVisitor(
private fun visitWithQualifiedAccess(qualifiedAccess: FirQualifiedAccess) {
return withQualifiedAccess(qualifiedAccess) {
runComponents(qualifiedAccess)
goToNestedDeclarations(qualifiedAccess)
visitNestedElements(qualifiedAccess)
}
}
private fun visitWithGetClassCall(getClassCall: FirGetClassCall) {
return withGetClassCall(getClassCall) {
runComponents(getClassCall)
goToNestedDeclarations(getClassCall)
visitNestedElements(getClassCall)
}
}
@@ -14,7 +14,7 @@ open class CheckerRunningDiagnosticCollectorVisitor(
components: List<AbstractDiagnosticCollectorComponent>
) : AbstractDiagnosticCollectorVisitor(context, components) {
override fun goToNestedDeclarations(element: FirElement) {
override fun visitNestedElements(element: FirElement) {
element.acceptChildren(this, null)
}
@@ -18,11 +18,11 @@ internal open class FirIdeDiagnosticVisitor(
) : CheckerRunningDiagnosticCollectorVisitor(context, components) {
private val beforeElementDiagnosticCollectionHandler = context.session.beforeElementDiagnosticCollectionHandler
override fun goToNestedDeclarations(element: FirElement) {
override fun visitNestedElements(element: FirElement) {
if (element is FirDeclaration) {
beforeElementDiagnosticCollectionHandler?.beforeGoingNestedDeclaration(element, context)
}
super.goToNestedDeclarations(element)
super.visitNestedElements(element)
}
override fun runComponents(element: FirElement) {
@@ -31,7 +31,7 @@ private class ContextCollectingDiagnosticCollectorVisitor private constructor(
}
}
override fun goToNestedDeclarations(element: FirElement) {
override fun visitNestedElements(element: FirElement) {
if (element is FirDeclaration) {
contextCollector.nextStep()
} else {