FIR: move components from AbstractDiagnosticCollectorVisitor to CheckerRunningDiagnosticCollectorVisitor

This commit is contained in:
Ilya Kirillov
2021-04-19 02:39:24 +02:00
parent ea233cddf8
commit f40f506852
4 changed files with 14 additions and 17 deletions
@@ -25,7 +25,7 @@ internal open class FirIdeDiagnosticVisitor(
super.visitNestedElements(element)
}
override fun runComponents(element: FirElement) {
override fun checkElement(element: FirElement) {
beforeElementDiagnosticCollectionHandler?.beforeCollectingForElement(element)
components.forEach {
checkCanceled()
@@ -20,8 +20,7 @@ private class ContextCollectingDiagnosticCollectorVisitor private constructor(
designation: FirDeclarationDesignation,
firFile: FirFile,
) : AbstractDiagnosticCollectorVisitor(
PersistentCheckerContextFactory.createEmptyPersistenceCheckerContext(sessionHolder),
components = emptyList()
PersistentCheckerContextFactory.createEmptyPersistenceCheckerContext(sessionHolder)
) {
private val contextCollector = object : ContextByDesignationCollector<PersistentCheckerContext>(designation, firFile) {
override fun getCurrentContext(): PersistentCheckerContext = context
@@ -39,7 +38,7 @@ private class ContextCollectingDiagnosticCollectorVisitor private constructor(
}
}
override fun runComponents(element: FirElement) {}
override fun checkElement(element: FirElement) {}
companion object {
fun collect(sessionHolder: SessionHolder, firFile: FirFile, designation: FirDeclarationDesignation): PersistentCheckerContext {