FIR IDE: add debug error message when not possible to find fir declarartion by psi

This commit is contained in:
Ilya Kirillov
2020-12-14 15:13:25 +01:00
parent 940ec06f5b
commit 67fc1bcb3d
@@ -91,7 +91,8 @@ private fun KtDeclaration.findSourceNonLocalFirDeclarationByProvider(
firFile.declarations
}
val original = originalDeclaration
declarations?.first { it.psi === this || it.psi == original }
declarations?.firstOrNull { it.psi == this || it.psi == original }
?: error("Cannot find corresponding fir for\n${this.getElementTextInContext()}")
}
this is KtConstructor<*> -> {
val containingClass = containingClassOrObject