FIR IDE: add check canceled between diagnostics
This commit is contained in:
+3
@@ -62,9 +62,12 @@ abstract class AbstractDiagnosticCollector(
|
|||||||
componentsInitialized = true
|
componentsInitialized = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected open fun beforeCollecting() {}
|
||||||
|
|
||||||
private inner class Visitor : FirDefaultVisitor<Unit, Nothing?>() {
|
private inner class Visitor : FirDefaultVisitor<Unit, Nothing?>() {
|
||||||
private fun <T : FirElement> T.runComponents() {
|
private fun <T : FirElement> T.runComponents() {
|
||||||
components.forEach {
|
components.forEach {
|
||||||
|
beforeCollecting()
|
||||||
this.accept(it, context)
|
this.accept(it, context)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
@@ -48,6 +48,10 @@ internal abstract class AbstractFirIdeDiagnosticsCollector(
|
|||||||
reporter = Reporter()
|
reporter = Reporter()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun beforeCollecting() {
|
||||||
|
checkCanceled()
|
||||||
|
}
|
||||||
|
|
||||||
override fun getCollectedDiagnostics(): Iterable<FirDiagnostic<*>> {
|
override fun getCollectedDiagnostics(): Iterable<FirDiagnostic<*>> {
|
||||||
// Not necessary in IDE
|
// Not necessary in IDE
|
||||||
return emptyList()
|
return emptyList()
|
||||||
|
|||||||
Reference in New Issue
Block a user