[FIR] Make diagnostics collectors returns List instead of Iterable
This commit is contained in:
+2
-2
@@ -33,7 +33,7 @@ abstract class AbstractDiagnosticCollector(
|
||||
override val scopeSession: ScopeSession = ScopeSession(),
|
||||
returnTypeCalculator: ReturnTypeCalculator = ReturnTypeCalculatorForFullBodyResolve()
|
||||
) : SessionHolder {
|
||||
fun collectDiagnostics(firFile: FirFile): Iterable<FirDiagnostic<*>> {
|
||||
fun collectDiagnostics(firFile: FirFile): List<FirDiagnostic<*>> {
|
||||
if (!componentsInitialized) {
|
||||
throw IllegalStateException("Components are not initialized")
|
||||
}
|
||||
@@ -43,7 +43,7 @@ abstract class AbstractDiagnosticCollector(
|
||||
}
|
||||
|
||||
protected abstract fun initializeCollector()
|
||||
protected abstract fun getCollectedDiagnostics(): Iterable<FirDiagnostic<*>>
|
||||
protected abstract fun getCollectedDiagnostics(): List<FirDiagnostic<*>>
|
||||
abstract val reporter: DiagnosticReporter
|
||||
|
||||
private val components: MutableList<AbstractDiagnosticCollectorComponent> = mutableListOf()
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ package org.jetbrains.kotlin.fir.analysis.collectors
|
||||
import org.jetbrains.kotlin.fir.FirSession
|
||||
|
||||
object FirDiagnosticsCollector {
|
||||
fun create(session: FirSession): AbstractDiagnosticCollector {
|
||||
fun create(session: FirSession): SimpleDiagnosticsCollector {
|
||||
val collector = SimpleDiagnosticsCollector(session)
|
||||
collector.registerAllComponents()
|
||||
return collector
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ class SimpleDiagnosticsCollector(session: FirSession) : AbstractDiagnosticCollec
|
||||
reporter = SimpleDiagnosticReporter()
|
||||
}
|
||||
|
||||
override fun getCollectedDiagnostics(): Iterable<FirDiagnostic<*>> {
|
||||
override fun getCollectedDiagnostics(): List<FirDiagnostic<*>> {
|
||||
return reporter.diagnostics
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ internal abstract class AbstractFirIdeDiagnosticsCollector(
|
||||
checkCanceled()
|
||||
}
|
||||
|
||||
override fun getCollectedDiagnostics(): Iterable<FirDiagnostic<*>> {
|
||||
override fun getCollectedDiagnostics(): List<FirDiagnostic<*>> {
|
||||
// Not necessary in IDE
|
||||
return emptyList()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user