FIR IDE: add check canceled between diagnostics

This commit is contained in:
Ilya Kirillov
2020-09-15 17:46:48 +03:00
parent 9dd3d8fb14
commit ee794f8664
2 changed files with 7 additions and 0 deletions
@@ -62,9 +62,12 @@ abstract class AbstractDiagnosticCollector(
componentsInitialized = true
}
protected open fun beforeCollecting() {}
private inner class Visitor : FirDefaultVisitor<Unit, Nothing?>() {
private fun <T : FirElement> T.runComponents() {
components.forEach {
beforeCollecting()
this.accept(it, context)
}
}
@@ -48,6 +48,10 @@ internal abstract class AbstractFirIdeDiagnosticsCollector(
reporter = Reporter()
}
override fun beforeCollecting() {
checkCanceled()
}
override fun getCollectedDiagnostics(): Iterable<FirDiagnostic<*>> {
// Not necessary in IDE
return emptyList()