FE: drop DiagnosticReporter.context.report & rename reportAndCommit

This commit is contained in:
Mikhail Glukhikh
2022-10-17 09:55:44 +02:00
committed by Space Team
parent 1826d9b332
commit d00af1c932
7 changed files with 20 additions and 39 deletions
@@ -58,47 +58,27 @@ open class KtDiagnosticReporterWithContext(
override val languageVersionSettings: LanguageVersionSettings
get() = this@KtDiagnosticReporterWithContext.languageVersionSettings
@OptIn(InternalDiagnosticFactoryMethod::class)
fun report(
factory: KtDiagnosticFactory0,
positioningStrategy: AbstractSourceElementPositioningStrategy? = null
) {
sourceElement?.let { report(factory.on(it, positioningStrategy), this) }
}
@OptIn(InternalDiagnosticFactoryMethod::class)
fun <A : Any> report(
factory: KtDiagnosticFactory1<A>,
a: A,
positioningStrategy: AbstractSourceElementPositioningStrategy? = null
) {
sourceElement?.let { report(factory.on(it, a, positioningStrategy), this) }
}
@OptIn(InternalDiagnosticFactoryMethod::class)
fun <A1 : Any, A2 : Any> report(
factory: KtDiagnosticFactory2<A1, A2>,
a1: A1,
a2: A2,
positioningStrategy: AbstractSourceElementPositioningStrategy? = null
) {
sourceElement?.let { report(factory.on(it, a1, a2, positioningStrategy), this) }
}
fun reportAndCommit(factory: KtDiagnosticFactory0) {
fun report(factory: KtDiagnosticFactory0) {
sourceElement?.let {
reportOn(it, factory, this)
checkAndCommitReportsOn(it, this)
}
}
fun <A : Any> reportAndCommit(factory: KtDiagnosticFactory1<A>, a: A) {
fun <A : Any> report(factory: KtDiagnosticFactory1<A>, a: A) {
sourceElement?.let {
reportOn(it, factory, a, this)
checkAndCommitReportsOn(it, this)
}
}
fun <A : Any, B : Any> report(factory: KtDiagnosticFactory2<A, B>, a: A, b: B) {
sourceElement?.let {
reportOn(it, factory, a, b, this)
checkAndCommitReportsOn(it, this)
}
}
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other !is DiagnosticContextImpl) return false