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