FIR: rename goToNestedDeclarations -> visitNestedElements
This commit is contained in:
+8
-8
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -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) {
|
||||
|
||||
+1
-1
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user